-
-
Notifications
You must be signed in to change notification settings - Fork 833
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
Some URLs with unescaped query strings cannot resolve relative redirects. #1833
Comments
I played with it a bit and the change did fail some tests and these cases seem legit. Namely httpx/tests/models/test_url.py Line 183 in 0a8b44e
I'm not an expert on RFC3986 to tell if the URL fits the spec (if this is a bug in rfc3986's implication). It would be the best if that library could handle this better/we use a more lenient library (internet is wild). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Still valid thx, @Stale bot. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
* Drop RawURL * First pass at adding urlparse * Update urlparse * Add urlparse * Add urlparse * Unicode non-printables can be valid in IDNA hostnames * Update _urlparse.py docstring * Linting * Trim away ununsed codepaths * Tweaks for path validation depending on scheme and authority presence * Minor cleanups * Minor cleanups * full_path -> raw_path, forr internal consistency * Linting fixes * Drop rfc3986 dependency * Add test for #1833 * Linting * Drop 'rfc3986' dependancy from README and docs homepage Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Discussed in #1816
Originally posted by kangzhang August 25, 2021
Hey there, we are running into a crash on httpx and wondering if we could get some help.
It seems rfc3986 is confused by certain URLs. To reproduce the bug:
It would throw a ResolutionError error about the URL.
Looking into the code, I'm wondering if we should patch this line and also set
query
toNone
: https://github.com/encode/httpx/blob/master/httpx/_models.py#L572The raw exception message:
Thank you!
The shortest way to reproduce this issue is something like...
The REF3986 package is using a regex to determine if a URL is in absolute form or not, and the query part does not match the regex. I think @kangzhang's suggestion to remove the query portion when joining URLs would resolve this, and looks like it still would give correctly resolved redirects, but it'd be worth making the change, and seeing if anything in the test suite changes as a result of the change or not.
The text was updated successfully, but these errors were encountered: