Evitar que wget ou curl removam “../” do URL consultado?

0

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

A seguinte consulta wget usando ../ no diretório transversal:

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

resulta na consulta efetiva com ../ removido do 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.

Como posso forçar o wget (ou curl ) a manter a URL original textualmente?

    
por user111854 16.08.2018 / 10:28

1 resposta

1

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

Veja RFC 3986

    
por 16.08.2018 / 11:58

Tags