-
Notifications
You must be signed in to change notification settings - Fork 79
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
URL parsing bug with http://example.com//foo/bar #391
Comments
Summary:A wrong path component is exposed to the plugins: Other observationsBrowsers would have parsed the URL and constructed an HTTP request before sending it to styx. This is how Styx sees is:
Because It is correct behaviour for Styx to proxy the request as |
Styx proxies the correct URL to origins because Okay. We now need to figure out how to extract the correct path component for use in Styx URL. |
Hi @taer. I have a fix in here: https://github.com/mikkokar/styx/tree/issue-391-url-parsing. Could you give it a try please? |
When a URL comes into Styx like this
https://test.homeaway.co.uk//www.homeaway.co.uk/p6873759, it gets messed up inside of Styx. The request path that pops out in the request.path()
path=/p6873759
because styx uses URI.create to parse the path from the HTTP first line path, and a //foo/bar as URI encodes foo as the host.
It's here in Styx's Url class
value here is just the contents from the first http line.
But, it also seems the downstream app is given the original request still. So origin will see path of
//www.homeaway.co.uk/p6873759
, while styx logged and treated as/p6873759
The text was updated successfully, but these errors were encountered: