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 se...@apache.org on 2006/01/13 21:11:12 UTC

svn commit: r368839 - /jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java

Author: sebb
Date: Fri Jan 13 12:11:08 2006
New Revision: 368839

URL: http://svn.apache.org/viewcvs?rev=368839&view=rev
Log:
See bug 38256 - handling of missing cookie path 

Modified:
    jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java

Modified: jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java
URL: http://svn.apache.org/viewcvs/jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java?rev=368839&r1=368838&r2=368839&view=diff
==============================================================================
--- jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java (original)
+++ jakarta/jmeter/branches/rel-2-1/src/protocol/http/org/apache/jmeter/protocol/http/control/CookieManager.java Fri Jan 13 12:11:08 2006
@@ -322,19 +322,24 @@
 		String domain = "." + url.getHost();  // $NON-NLS-1$ // this is the default
 		// the leading dot breaks the standard, but helps in
 		// reproducing actual browser behaviour.
-		// The default is the path of the request URL (upto and including the last slash)
-		String path = url.getPath();
-		if (path.length() == 0) {
-			path = "/"; // $NON-NLS-1$ default if no path specified
-		} else {
-			int lastSlash = path.lastIndexOf("/");// $NON-NLS-1$
-			if (lastSlash > 0) {// Must be after initial character
-                // Upto, but not including, trailing slash for Set-Cookie:
-                // (Set-Cookie2: would need the trailing slash as well
-				path=path.substring(0,lastSlash);
-			}
-		}
 
+		// The default is the path of the request URL (upto and including the last slash)
+//		String path = url.getPath();
+//		if (path.length() == 0) {
+//			path = "/"; // $NON-NLS-1$ default if no path specified
+//		} else {
+//			int lastSlash = path.lastIndexOf("/");// $NON-NLS-1$
+//			if (lastSlash > 0) {// Must be after initial character
+//                // Upto, but not including, trailing slash for Set-Cookie:
+//                // (Set-Cookie2: would need the trailing slash as well
+//				path=path.substring(0,lastSlash);
+//			}
+//		}
+//      Bug 38256 - replaced by the line below:
+		String path="/";
+		
+		//TODO use HttpClient Cookie handling (one day)
+		
 		Cookie newCookie = new Cookie(name, value, domain, path, false
                                     , 0); // No expiry means session cookie
 



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