Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New step: parse_url #30

Closed
wojtekmach opened this issue Aug 10, 2021 · 3 comments
Closed

New step: parse_url #30

wojtekmach opened this issue Aug 10, 2021 · 3 comments

Comments

@wojtekmach
Copy link
Owner

In curl, these three invocations are equivalent:

$ curl http://localhost:4000/api
$ curl localhost:4000/api
$ curl :4000/api

let's add a parse_url step that will fill in the missing scheme and host.

@wojtekmach wojtekmach added the good first issue Good for newcomers label Aug 10, 2021
@wojtekmach
Copy link
Owner Author

wojtekmach commented Nov 8, 2021

This step could make working with UNIX sockets more convenient too:

Instead of:

Req.get!("http:///v1.41/images/json", unix_socket: "/var/run/docker.sock")

do:

Req.get!("http+unix:///var/run/docker.sock/v1.41/images/json")

(or: "http+unix://%2Fvar%2Frun%2Fdocker.sock/v1.41/images/json", see: whatwg/url#577)

@wojtekmach wojtekmach changed the title Add parse_url step New step: parse_url Dec 27, 2021
@wojtekmach
Copy link
Owner Author

wojtekmach commented Jan 18, 2022

This step should perhaps automatically set request.path to "/" if it was empty.

Nevermind, that would seem to be against https://datatracker.ietf.org/doc/html/rfc3986#section-3.3.

@wojtekmach wojtekmach removed the good first issue Good for newcomers label Feb 8, 2022
@wojtekmach
Copy link
Owner Author

Let's hold off on this for now>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant