cURL / Mailing Lists / curl-users / Single Mail


Re: Whitespace in a Location: Hint

From: Daniel Stenberg <>
Date: Sat, 15 Jun 2002 13:51:03 +0200 (MET DST)

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.


   All unsafe characters must always be encoded within a URL.
--- snip ---

    Daniel Stenberg -- curl groks URLs --
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -
Received on 2002-06-15