olegk       2003/03/08 13:30:02

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HeaderElement.java
  Log:
  Fixes the problem with the HTTP header element parser using case-sensitive string 
matching
  
  Contributed by Padraig O'hIceadha <[EMAIL PROTECTED]>
  Reviewed by Oleg Kalnichevski
  
  Revision  Changes    Path
  1.17      +19 -18    
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HeaderElement.java
  
  Index: HeaderElement.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HeaderElement.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- HeaderElement.java        31 Jan 2003 00:33:36 -0000      1.16
  +++ HeaderElement.java        8 Mar 2003 21:30:02 -0000       1.17
  @@ -302,20 +302,21 @@
                    * For the general cases, rfc1123-date, rfc850-date.
                    */
                   if (tokenizer.hasMoreTokens()) {
  -                    if (nextToken.endsWith("Mon") 
  -                        || nextToken.endsWith("Tue")
  -                        || nextToken.endsWith("Wed") 
  -                        || nextToken.endsWith("Thu")
  -                        || nextToken.endsWith("Fri")
  -                        || nextToken.endsWith("Sat")
  -                        || nextToken.endsWith("Sun")
  -                        || nextToken.endsWith("Monday") 
  -                        || nextToken.endsWith("Tuesday") 
  -                        || nextToken.endsWith("Wednesday") 
  -                        || nextToken.endsWith("Thursday") 
  -                        || nextToken.endsWith("Friday") 
  -                        || nextToken.endsWith("Saturday") 
  -                        || nextToken.endsWith("Sunday")) {
  +                    String s = nextToken.toLowerCase();
  +                    if (nextToken.endsWith("mon") 
  +                        || s.endsWith("tue")
  +                        || s.endsWith("wed") 
  +                        || s.endsWith("thu")
  +                        || s.endsWith("fri")
  +                        || s.endsWith("sat")
  +                        || s.endsWith("sun")
  +                        || s.endsWith("monday") 
  +                        || s.endsWith("tuesday") 
  +                        || s.endsWith("wednesday") 
  +                        || s.endsWith("thursday") 
  +                        || s.endsWith("friday") 
  +                        || s.endsWith("saturday") 
  +                        || s.endsWith("sunday")) {
   
                           nextToken += "," + tokenizer.nextToken();
                       }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to