cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1364835 ] curl drops end of URL if URL references a directory

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Tue, 29 Nov 2005 02:15:56 -0800

Bugs item #1364835, was opened at 2005-11-23 18:07
Message generated for change (Settings changed) made by bagder
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1364835&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: documentation
Group: bad behaviour
>Status: Closed
Resolution: Accepted
Priority: 5
Submitted By: Tom Wood (woodts)
Assigned to: Daniel Stenberg (bagder)
Summary: curl drops end of URL if URL references a directory

Initial Comment:
curl-7.13.1-3 in Fedora Core 4, possibly elsewhere,
doesn't properly handle the end of the URL when the URL
ends with a directory not terminated with a "/".
For example,

given that ftp://whatever/wherever/blah is a directory,
curl -l -s --disable-epsv ftp://whatever/wherever/blah
returns the directory contents of
ftp://whatever/wherever, not the contents of the
ftp://whatever/wherever/blah directory. In fact,
substitute anything for blah, even something that does
not exist, and you get the same result as above. You
have to add a trailing "/" to get the directory listing
of the desired directory.

Please note that the command switches -s and
--disable-epsv may not be part of the problem here.
I've included them for completeness in that they're
part of my test case and may have an impact.

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2005-11-23 20:51

Message:
Logged In: YES
user_id=1110

I decided to do that since a URL in itself doesn't tell if
it is a directory or a file you want.

If you think it should behave differently, I suggest you
take this issue to a suitable curl mailing list and provide
a proposal on how libcurl should behave on what inputs.
Preferably with an accompanying patch. It is simply not a
bug but a request for a modified behaviour.

I can use environment variables fine with curl exactly the
way you describe. Either way, it is not a subject for this
bug report, and I can't even think of how curl could prevent
that command line to work.

----------------------------------------------------------------------

Comment By: Tom Wood (woodts)
Date: 2005-11-23 20:42

Message:
Logged In: YES
user_id=1386951

Why this design decision? It seems that this is incorrect,
as a properly formed URL doesn't do what you would expect.
Arguing from a standards viewpoint, this is the only piece
of software that I've seen that treats URLs like this. I'd
argue that this needs to be changed.

Another annoyance is that I can't use an environment
variable in Linux as the URL. For instance, curl $GETME
doesn't work (gives curl: (3) URL using bad/illegal format
or missing URL). But I can do curl -l $GETME and get a
directory listing. This seems inconsistent and possibly in
error.

Thanks for the timely response!

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2005-11-23 19:59

Message:
Logged In: YES
user_id=1110

Yes, this is a matter of fact how curl is designed to
work... I guess it can/should be (better) documented.

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1364835&group_id=976
Received on 2005-11-29

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET