morgand 01/06/27 13:40:07
Modified: httpclient/src/java/org/apache/commons/httpclient
Cookie.java
Log:
fixed bug where parameter-less cookies were not being stored, cookies
are not setting the paths correct, which should be fixed
Revision Changes Path
1.3 +8 -4
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java
Index: Cookie.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Cookie.java 2001/05/14 19:57:08 1.2
+++ Cookie.java 2001/06/27 20:40:05 1.3
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java,v
1.2 2001/05/14 19:57:08 morgand Exp $
- * $Revision: 1.2 $
- * $Date: 2001/05/14 19:57:08 $
+ * $Header:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/Cookie.java,v
1.3 2001/06/27 20:40:05 morgand Exp $
+ * $Revision: 1.3 $
+ * $Date: 2001/06/27 20:40:05 $
*
* ====================================================================
*
@@ -388,9 +388,13 @@
// cycle through the parameters
NameValuePair[] parameters = headerElements[i].getParameters();
// could be null. In case only a header element and no parameters.
- if (parameters == null)
+ if (parameters == null) {
+ cookies[index++] = cookie;
+ // fix me, should be directory of the request, not root dir
+ cookie.setPath("/");
// go to the next header element.
continue;
+ }
boolean discard_set = false, secure_set = false;
for (int j = 0; j < parameters.length; j++) {
String name = parameters[j].getName().toLowerCase();