Improve HTTP specification compliance
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 1 Feb 2011 22:12:18 +0000 (22:12 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 1 Feb 2011 22:12:18 +0000 (22:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1066244 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/connector/Request.java
webapps/docs/changelog.xml

index e2c2399..2312194 100644 (file)
@@ -3005,7 +3005,12 @@ public class Request
             int semi = entry.indexOf(";q=");
             if (semi >= 0) {
                 try {
-                    quality = Double.parseDouble(entry.substring(semi + 3));
+                    String strQuality = entry.substring(semi + 3);
+                    if (strQuality.length() <= 5) {
+                        quality = Double.parseDouble(strQuality);
+                    } else {
+                        quality = 0.0;
+                    }
                 } catch (NumberFormatException e) {
                     quality = 0.0;
                 }
index 5b7f1c9..fd6d004 100644 (file)
         to <code>false</code> in the Host where a web application is deployed.
         (markt)
       </fix>
+      <fix>
+        Improve HTTP specification compliance in support of
+        <code>Accept-Language</code> header. (kkolinko)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">