cURL / Mailing Lists / curl-users / Single Mail

curl-users

Whitespace in a Location: Hint

From: Sarnicola, Anthony (Exchange) <asarnicola_at_bear.com>
Date: Fri, 14 Jun 2002 17:19:39 -0400

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.

I'm running curl like this:

curl -N -L -b ./cookies -c ./cookies -A "Mozilla/4.0 (compatible; MSIE 5.01;
WindowsNT)" -H "Accept: application/vnd.ms-excel, application/msword,
application/vnd.ms-powerpoint, image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*" --trace-ascii ./trace -O
"https://my.server.com/My%20File.doc"

The trace output looks like this:

0000: GET /My%20File.doc HTTP/1.1
0029: User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; WindowsNT)
0065: Host: my.server.com
0083: Pragma: no-cache
0095: Cookie: DocCookie=3b14360f381b4a44
00b8: Accept: application/vnd.ms-excel, application/msword, applicatio
00f8: n/vnd.ms-powerpoint, image/gif, image/x-xbitmap, image/jpeg, ima
0138: ge/pjpeg, */*
0147:
.
.
.
<= Recv header, 105 bytes (0x69)
0000: Location: https://my.server.com:443/My File
0040: .doc?&STCO=1PQpV-M_at_i4CwAAGNMb2c&STCOEND
<= Recv header, 19 bytes (0x13)
0000: Connection: close
<= Recv header, 45 bytes (0x2d)
0000: Content-Type: text/html; charset=iso-8859-1
== Info: Follow to new URL: https://my.server.com:443/My
== Info: Closing connection #0
== Info: Follows Location: to new URL: 'https://my.server.com:443/My'
.
.
.
0000: GET /My HTTP/1.1
0014: User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; WindowsNT)
0050: Host: my.server.com
006e: Pragma: no-cache
0080: Cookie: FDX=PQpV-M_at_i4CwAAGNMb2c; DocCookie=6b503b663d5f447e
00bc: Accept: application/vnd.ms-excel, application/msword, applicatio
00fc: n/vnd.ms-powerpoint, image/gif, image/x-xbitmap, image/jpeg, ima
013c: ge/pjpeg, */*
014b:
<= Recv header, 24 bytes (0x18)
0000: HTTP/1.0 404 Not Found

***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.
***********************************************************************

_______________________________________________________________

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-14