From 00eb9f19cdfc0a36bc3e4c1bd88e7507d6b751e3 Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 19 Jul 2007 02:41:08 +0000 Subject: [PATCH] Make cookie handling conform to RFC2965. Don't treat the single quote character as special. git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@557467 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/tomcat/util/http/Cookies.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/java/org/apache/tomcat/util/http/Cookies.java b/java/org/apache/tomcat/util/http/Cookies.java index fcc931d1d..a1f451492 100644 --- a/java/org/apache/tomcat/util/http/Cookies.java +++ b/java/org/apache/tomcat/util/http/Cookies.java @@ -249,7 +249,7 @@ public final class Cookies { // extends MultiMap { int endValue=startValue; cc=bytes[pos]; - if( cc== '\'' || cc=='"' ) { + if( cc=='"' ) { endValue=findDelim3( bytes, startValue+1, end, cc ); if (endValue == -1) { endValue=findDelim2( bytes, startValue+1, end ); @@ -412,7 +412,7 @@ public final class Cookies { // extends MultiMap { /** * * Strips quotes from the start and end of the cookie string - * This conforms to RFC 2109 + * This conforms to RFC 2965 * * @param value a String specifying the cookie * value (possibly quoted). @@ -423,8 +423,7 @@ public final class Cookies { // extends MultiMap { private static String stripQuote( String value ) { // log("Strip quote from " + value ); - if (((value.startsWith("\"")) && (value.endsWith("\""))) || - ((value.startsWith("'") && (value.endsWith("'"))))) { + if (value.startsWith("\"") && value.endsWith("\"")) { try { return value.substring(1,value.length()-1); } catch (Exception ex) { -- 2.11.0