juergen 2002/07/04 03:21:39
Modified: src/webdav/client/src/org/apache/commons/httpclient
HttpClient.java
Log:
the http protocol allows multiple http headers with an identical name. in this case
concat the value of each header in a comma seperated list.
Revision Changes Path
1.13 +12 -6
jakarta-slide/src/webdav/client/src/org/apache/commons/httpclient/HttpClient.java
Index: HttpClient.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/client/src/org/apache/commons/httpclient/HttpClient.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- HttpClient.java 25 Apr 2002 21:12:31 -0000 1.12
+++ HttpClient.java 4 Jul 2002 10:21:38 -0000 1.13
@@ -1154,12 +1154,18 @@
// Parse the header name and value
int colon = line.indexOf(":");
if (colon < 0)
- throw new HttpException("Incorrect headers");
+ throw new HttpException("Incorrect headers");
+
String name = line.substring(0, colon).trim();
String match = name.toLowerCase();
String value = line.substring(colon + 1).trim();
- Header header = new Header(name, value);
- result.put(match, header);
+
+ Header oldHeader = (Header)result.get(match);
+ if (oldHeader != null) {
+ value = oldHeader.getValue() + ", " + value;
+ }
+
+ result.put(match, new Header(name, value));
if (debug > 0) {
System.out.println(name + ": " + value);
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>