hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r156284 - jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HeaderElement.java
Date Sat, 05 Mar 2005 22:43:58 GMT
Author: olegk
Date: Sat Mar  5 14:43:58 2005
New Revision: 156284

URL: http://svn.apache.org/viewcvs?view=rev&rev=156284
Log:
Allow empty header elements

Modified:
    jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HeaderElement.java

Modified: jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HeaderElement.java
URL: http://svn.apache.org/viewcvs/jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HeaderElement.java?view=diff&r1=156283&r2=156284
==============================================================================
--- jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HeaderElement.java (original)
+++ jakarta/httpclient/trunk/http-common/src/java/org/apache/http/HeaderElement.java Sat Mar
 5 14:43:58 2005
@@ -142,7 +142,9 @@
                 this.parameters = null;
             }
         } else {
-            throw new IllegalArgumentException("Empty array of chars");
+            this.name = "";
+            this.value = null;
+            this.parameters = null;
         }
     }
 
@@ -218,7 +220,7 @@
             } else if (i == len - 1) {
                 element = new HeaderElement(headerValue, from, len);
             }
-            if (element != null) {
+            if (element != null && !element.getName().equals("")) {
                 elements.add(element);
             }
             i++;



Mime
View raw message