curl-users
Re: Spaces in redirects
Date: Fri, 6 Jun 2003 11:22:01 +0200 (CEST)
On Fri, 6 Jun 2003, Ralph Mitchell wrote:
> I decided to have a go at patching it up myself. The attached diff patches
> lib/transfer.c to replace spaces with plus-signs in the redirect url.
> This is against curl-7.10.5.
>
> BTW, it works just great - I can now get past the login and pull subsequent
> pages.
Just a little remark on the patch. It only works for a subset of possible
location headers with spaces, while others will be a bit surprising. See:
A) Location: /script.cgi?name=daniel stenberg&age=ooold
This is the case your patch solves.
B) Location: http://www.host with spaces.com/
This is one truly bad location in the first place, as host names can't have
spaces but your patch may convert it into a legal(?) host name. At least
different.
C) Location: directory with spaces/file/index.html
This is perhaps more interesting, as directories sometimes contain spaces.
However, the correct URL code for the spaces here is "%20". The '+' for
spaces is only valid on the right side of the '?' letter (AFAIR).
What does the browsers do on these kinds of headers?
-- Daniel Stenberg -- curl: been grokking URLs since 1998 ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com.Received on 2003-06-06