cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Whitespace in a Location: Hint

From: James Cox <imajes_at_php.net>
Date: Sun, 16 Jun 2002 03:59:30 +0100

>
> On Fri, 14 Jun 2002, Sarnicola, Anthony (Exchange) wrote:
>
> > I'm not sure if there's an option I'm missing or if this is a
> problem. I
> > am using the command line curl to get a file that has a space in the
> > filename. I request it from the server URL encoded. But the
> server sends
> > back a Location hint with a space rather than %20. When curl
> attempts the
> > next GET, the filename is truncated at the space and the server
> (correctly)
> > responds with a 404 Not Found error. Any help is appreciated.
>
> curl does not deal with spaces in Location: strings. Of course,
> we can always
> debate if that is a wise decision or not, but it is based on what the
> standards say about URLs. Do the browsers really get along with this?
>
> Quote from RFC1734 (Uniform Resource Locators), section 2.2:
>
> --- snip ---
> Characters can be unsafe for a number of reasons. The space
> character is unsafe because significant spaces may disappear and
> insignificant spaces may be introduced when URLs are transcribed or
> typeset or subjected to the treatment of word-processing programs.
>
> ...

Daniel: what Anthony described is that curl is taking a correctly urlencoded
url and url-decoding it... so if there is a space url encoded, it'll decode
the %20 into a space, however it does it before it reaches the document,
therefore causing a problem.

whilst i agree that spaces suck, and should be mostly disregarded, it is
still a valid issue.

my 2?.

 -- james

--
James Cox :: imajes@php.net :: Landonize It! http://landonize.it/
Was I helpful?  http://www.amazon.co.uk/exec/obidos/wishlist/23IVGHQ61RJGO/
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
Received on 2002-06-16