Author: remy.maucherat(a)jboss.com
Date: 2007-07-18 23:00:49 -0400 (Wed, 18 Jul 2007)
New Revision: 201
Modified:
trunk/java/org/apache/tomcat/util/http/Cookies.java
Log:
- Single quote handling improvement in cookies.
Modified: trunk/java/org/apache/tomcat/util/http/Cookies.java
===================================================================
--- trunk/java/org/apache/tomcat/util/http/Cookies.java 2007-07-19 02:59:37 UTC (rev 200)
+++ trunk/java/org/apache/tomcat/util/http/Cookies.java 2007-07-19 03:00:49 UTC (rev 201)
@@ -249,7 +249,7 @@
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 );
@@ -343,7 +343,6 @@
*/
public static int findDelim3( byte bytes[], int off, int end, byte cc )
{
- byte prev = bytes[off];
while( off < end ) {
byte b=bytes[off];
if ( b== '\\' ) {
@@ -413,7 +412,7 @@
/**
*
* Strips quotes from the start and end of the cookie string
- * This conforms to RFC 2109
+ * This conforms to RFC 2965
*
* @param value a <code>String</code> specifying the cookie
* value (possibly quoted).
@@ -424,8 +423,7 @@
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) {
Show replies by date