[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] Quotes get striped in cookie values
From: |
Giuseppe Scrivano |
Subject: |
Re: [Bug-wget] Quotes get striped in cookie values |
Date: |
Tue, 02 Aug 2011 23:09:50 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
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 +0000
+++ src/cookies.c 2011-08-02 20:53:42 +0000
@@ -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 <address@hidden> 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.