You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2001/06/08 00:51:53 UTC

[Bug 2063] New: - CookieManager truncates cookie values if values contain '='

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2063

*** shadow/2063	Thu Jun  7 15:51:53 2001
--- shadow/2063.tmp.16005	Thu Jun  7 15:51:53 2001
***************
*** 0 ****
--- 1,45 ----
+ +============================================================================+
+ | CookieManager truncates cookie values if values contain '='                |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 2063                        Product: JMeter                  |
+ |       Status: NEW                         Version: unspecified             |
+ |   Resolution:                            Platform: All                     |
+ |     Severity: Major                    OS/Version: All                     |
+ |     Priority: Other                     Component: Main                    |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: jmeter-dev@jakarta.apache.org                                |
+ |  Reported By: mmissire@pacbell.net                                         |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ CookieManager.java (in version 1.6Alpha) trucates the value of cookies if those 
+ values themselves contain a '=' character. This is due to some StringTokenizer 
+ use which doesn't seem quite right.
+ 
+ Some sites, such as Netscape's UREG login page for it's online Calendar 
+ (calendar.netscape.com) set such cookies.
+ 
+ Here is a proposed fix which worked for me:
+ From CookieManager.java's addCookieFromHeader() method:
+ 
+                  // Bug: if cookie value contains a '='
+                  // character, like Netcenter UREG
+                  // cookies (i.e. "NSCP_USER_LOGIN1_NEW=SHA=xxxxx"),
+                  // this fails.
+ 		 //String value = nvpTokenizer.nextToken();
+ 
+                   String value="";
+                   int cookieValueContainsEquals = nvp.indexOf('=');
+                   if( cookieValueContainsEquals != -1 && 
+ cookieValueContainsEquals < nvp.length() )
+                   {
+                       StringBuffer tmpBuffer = new StringBuffer(nvp);
+                       value=tmpBuffer.substring( nvp.indexOf('=')+1 );
+                   } else
+                       value=nvpTokenizer.nextToken();
+ 
+ 
+ --------------------------------------------------------------------------
+ Hope this helps. -Marc Missire (mmissire@pacbell.net)
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org