-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Redirects to absolute URLs mangle on master #443
Comments
Good catch. Confirmed. Introduced in the recent Typed URI change. |
I was going to submit a PR for this, but I wanted to ask a question first. Is there any reason to avoid using the url crate? The example on the front page of the docs seems like it would solve the problem of redirecting to a full URI. I'm sure you know but the problem pointed out here is that the |
If you want to know why Rocket (and Hyper) use their own Uri types rather than Url, you can read the discussion here about it. Rockets Uri is not the same as Hypers Uri (which is new in the async 0.11 release) but the reasoning behind why it exists is the same. |
Thanks for sharing! In that case, I don't know what the best course of action is here then. I'd still be happy to submit a PR though. |
This issue arose because of a change to how the The The fix I'd like to take is to expand the This expansion will be a full rewrite of the |
This comment is pedantic, but I thought I'd mention it anyway. @SergioBenitez what you implemented is not a URI parser but a "Request Target" parser, as specified in https://tools.ietf.org/html/rfc7230#section-5.3. A Request Target is not a URI, though it is strongly related in that is is defined by reference to the URI specification https://tools.ietf.org/html/rfc3986. Strictly speaking only the absolute-form of Request Target is a URI (though not any URI). The |
My apologies for responding two years late; I'm only now working through the related URI issues. I simply wanted to state that I was and am aware of the differences, and that my use of the name I understand your point, and I agree on technical standing alone, but ultimately we choose names to convey meaning, and in this, I feel that |
The following sample on 0.3 redirects properly to Google:
On git master right now, it mangles the url into "/https:/www.google.com" which it then tries to interpret as a local address (http://localhost:8000/https:/www.google.com).
To make sure this wasn't just a brain fart, I tried putting Rustly on git Rocket. Its redirects are similarly mangled (http://localhost:8000/gY -> http://localhost:8000/https:/www.matthias-endler.de).
The text was updated successfully, but these errors were encountered: