cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 12 Apr 2007 21:55:38 +0200 (CEST)

On Thu, 12 Apr 2007, Song Ma wrote:

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

It certainly seems like a reasonable request, yes.

> For my interesting, I gave try for this invalid range in HTTP:

[...]

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

That's been a kind of design philosophy all the way: let the user decide. But
I can agree that a warning is suitable.

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

I think most servers will just ignore it when that weird. But I bet not all
will.

You up to making a patch for this?

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-04-12