You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Todd Parnell <tp...@vecna.com> on 2004/03/18 21:39:44 UTC

Small fix for CookieManager - domains with leading spaces

Hi all,

I encountered a problem with cookies coming back from Oracle9iAS where
cookies would have leading spaces in the domain portion.  For instance,
'domain= .mydomain.com;'.  Both IE6 on W2K and Moz 1.6 on W2K and Linux
trim the domain.  JMeter doesn't, and then proceeds to store the domain
as '. .mydomain.com' due to the comments in CookieManager (lines
394-396).

Here's a small patch that changes JMeter's behavior to match the
browsers.

Thanks,

Todd

Index:
src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
===================================================================
RCS file:
/home/cvspublic/jakarta-jmeter/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java,v
retrieving revision 1.25
diff -u -w -r1.25 CookieManager.java
---
src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java16 Mar 2004 19:48:57 -0000      1.25
+++
src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java18 Mar 2004 20:22:09 -0000
@@ -394,6 +394,7 @@
                 // The standard dictates domains must have a leading
dot,
                 // but the new standard (Cookie2) tells us to add it if
it's not
                 // there:
+               domain = domain.trim();
                 if (!domain.startsWith("."))
                 {
                     domain= "."+domain;





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


Re: Small fix for CookieManager - domains with leading spaces

Posted by Michal Kostrzewa <M....@pentacomp.com.pl>.
Dnia czw 18. marca 2004 21:39, Todd Parnell napisaƂ:
> Hi all,
>
> I encountered a problem with cookies coming back from Oracle9iAS where
> cookies would have leading spaces in the domain portion.  For instance,
> 'domain= .mydomain.com;'.  Both IE6 on W2K and Moz 1.6 on W2K and Linux
> trim the domain.  JMeter doesn't, and then proceeds to store the domain
> as '. .mydomain.com' due to the comments in CookieManager (lines
> 394-396).

Thank you for the patch, I'll check it out and commit it. Any objections? :) 

best regards,
Michal Kostrzewa

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