cURL / Mailing Lists / curl-users / Single Mail

curl-users

Maybe cURL manual shall state something about the invalid range user input for FTP?

From: Song Ma <songmash_at_gmail.com>
Date: Thu, 12 Apr 2007 16:23:21 +0800

Hi,

Today when I am using curl to do a ftp downloading like this:
      curl -v ftp://myhost/myfile -u myaccount -r =-=
the "-r =-=" was typed in by mistake. However, to my surprise, curl quietly
omitted my typo and retrieved all contents of "myfile" to me. I am not
saying this is implausible, I am think maybe curl can give some warning or
prompt for user when it obviously find no digits in the "-r" range options.

For my interesting, I gave try for this invalid range in HTTP:
      curl -v http://www.google.com -r =-=
the request was sent like this:
> GET / HTTP/1.1
> Range: bytes==-=
> User-Agent: curl/7.16.0 (i686-pc-linux-gnu) libcurl/7.16.0
OpenSSL/0.9.7d zlib/1.2.3 libidn/0.6.0
> Host: www.google.com
> Accept: */*

Again curl quietly pass this obvious invalid option. It looks like curl just
get the "Range" parameter directly from user's input then fill it in the
HTTP request. Although I have seen server just reply everything as if it
didn't receive "Range", does anyone have any idea what HTTP server will
treat invalid "Range" command? Can it cause any problem for server side?

Thanks,
Song Ma
Received on 2007-04-12