bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Nirgal Vourgère
Subject: Re: [Bug-wget] Quotes get striped in cookie values
Date: Tue, 2 Aug 2011 21:50:25 +0000
User-agent: KMail/1.13.5 (Linux/2.6.32-5-686; KDE/4.4.5; i686; ; )

Excellent.
It's great you got time to look at that one.
Thank you :)

Regarding whether this is wrong or not, I'm not 100% sure either.
RFC talks about quoted-strings, and that one doesn't need to be quoted. But 
does that mean it is ok for the client to remove the quotes?
Anyways, I think that it is best to send it back to the server exactly as it 
was received.


On Tuesday 02 August 2011 21:09:50 you wrote:
> 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.
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]