0

Prevent wget or curl from removing "../" from queried URL?

The following wget query using ../ to directory traverse:

wget http://192.168.0.24:7002/../../../../../mydir/myfile.txt

results in the effective query with ../ removed from the URL:

--2018-08-16 10:22:53--  http://192.168.0.24:7002/mydir/myfile.txt
Connecting to 192.168.0.24:7002... connected.
HTTP request sent, awaiting response... No data received.
Retrying.

How can I force wget (or curl) to keep the original URL verbatim?

1 Answer 1

2

For curl try

 curl --path-as-is

--path-as-is

Tell curl to not handle sequences of /../ or /./ in the given URL path. Normally curl will squash or merge them according to standards but with this option set you tell it not to do that.

Added in 7.42.0.

See RFC 3986

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .