question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Equivalent of path-as-is option in curl

See original GitHub issue

In curl there is the --path-as-is option:

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.

Currently, httpie does not send paths like /../../../../../ to the server but resolves and removes them locally.

Sending such sequences can be useful during security testing, e.g. checking directory traversal vulnerabilities.

I would like to request a similar option as curl’s --path-as-is.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jakubroztocilcommented, Apr 13, 2020

@exploide the linked issue includes a comment with a decent workaround, so I’ve just pushed support for --path-as-is to master (will be shipped with a future > v2.0.0 release).

$ http  --path-as-is  --offline  example.org/../../etc/password
GET /../../etc/password HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: example.org
User-Agent: HTTPie/2.1.0-dev
0reactions
exploidecommented, Apr 14, 2020

Awesome. That was fast. Thanks! 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

curl ootw: –path-as-is - Daniel Stenberg - Haxx
--path-as-is is a boolean option that was added in curl 7.42.0. ... The example URL above will be massaged into the final version: ......
Read more >
curl.1 the man page
curl supports HTTP with numerous options and variations. It can speak HTTP version 0.9, 1.0, 1.1, 2 and 3 depending on build options...
Read more >
Command line options - Everything curl
Command line options pass on information to curl about how you want it to behave. Like you can ask curl to switch on...
Read more >
4. curl options
curl is a command line tool and library for transferring data with URL syntax, supporting (lots of protocols) . curl has many options...
Read more >
curl man page
The HTTP-header includes things like server-name, date of the document, HTTP-version and more... If this option is used twice, the second will again...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found