[Bug-wget] Quotes get striped in cookie values

2011-08-02 Thread Nirgal Vourgère
Hello

When server sends header:
Set-Cookie: 
SSOCOOKIECC=L2ZS6azH5Mc4dwO/601i9QgGInPjnaaCeQWLTQbV3JD+RbT1Ryw/6ahTJS+boW94I86y3k62U1iIOOXv3cqPxw==;
 Version=1; Path=/
wget sends afterward:
Cookie: 
SSOCOOKIECC=L2ZS6azH5Mc4dwO/601i9QgGInPjnaaCeQWLTQbV3JD+RbT1Ryw/6ahTJS+boW94I86y3k62U1iIOOXv3cqPxw==
while it should be sending:
Cookie: 
SSOCOOKIECC=L2ZS6azH5Mc4dwO/601i9QgGInPjnaaCeQWLTQbV3JD+RbT1Ryw/6ahTJS+boW94I86y3k62U1iIOOXv3cqPxw==

Curl and Iceweasel works fine with that kind of cookies.

That feature was originally repported on Debian bug tracking system at:
http://bugs.debian.org/587033

I am no longer using that web site, and I had switched to curl anyways when I 
did, so I don't really need a fix.
But I lost many hours on that problem, and if someone could have a look, it 
might save other people some time in the future.



Re: [Bug-wget] Quotes get striped in cookie values

2011-08-02 Thread Giuseppe Scrivano
Hello Nirgal,

thanks to have reported it.  I am not sure it is really wrong to omit
quotes but in any case I am going to apply this patch:

=== modified file 'src/cookies.c'
--- src/cookies.c   2011-01-01 12:19:37 +
+++ src/cookies.c   2011-08-02 20:53:42 +
@@ -350,6 +350,13 @@
 goto error;
   if (!value.b)
 goto error;
+
+  /* If the value is quoted, do not modify it.  */
+  if (*(value.b - 1) == '')
+value.b--;
+  if (*value.e == '')
+value.e++;
+
   cookie-attr = strdupdelim (name.b, name.e);
   cookie-value = strdupdelim (value.b, value.e);
 

Cheers,
Giuseppe



Nirgal Vourgère jmv_...@nirgal.com writes:

 Hello

 When server sends header:
 Set-Cookie: 
 SSOCOOKIECC=L2ZS6azH5Mc4dwO/601i9QgGInPjnaaCeQWLTQbV3JD+RbT1Ryw/6ahTJS+boW94I86y3k62U1iIOOXv3cqPxw==;
  Version=1; Path=/
 wget sends afterward:
 Cookie: 
 SSOCOOKIECC=L2ZS6azH5Mc4dwO/601i9QgGInPjnaaCeQWLTQbV3JD+RbT1Ryw/6ahTJS+boW94I86y3k62U1iIOOXv3cqPxw==
 while it should be sending:
 Cookie: 
 SSOCOOKIECC=L2ZS6azH5Mc4dwO/601i9QgGInPjnaaCeQWLTQbV3JD+RbT1Ryw/6ahTJS+boW94I86y3k62U1iIOOXv3cqPxw==

 Curl and Iceweasel works fine with that kind of cookies.

 That feature was originally repported on Debian bug tracking system at:
 http://bugs.debian.org/587033

 I am no longer using that web site, and I had switched to curl anyways when I 
 did, so I don't really need a fix.
 But I lost many hours on that problem, and if someone could have a look, it 
 might save other people some time in the future.