-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Disable aiohttp requoting of redirection URL #5459
Disable aiohttp requoting of redirection URL #5459
Conversation
The documentation is not available anymore as the PR was closed or merged. |
Comment by @lhoestq:
|
The lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with aligning with requests
- this way we have less differences between streaming and non-streaming.
Maybe add a comment on why you needed to add this parameter ?
Indeed, the In [1]: from requests.utils import requote_uri
In [2]: url = "https://netloc/path?param=param%27%27value"
In [3]: url
Out[3]: 'https://netloc/path?param=param%27%27value'
In [4]: requote_uri(url)
Out[4]: 'https://netloc/path?param=param%27%27value' However, the In [5]: from yarl import URL
In [6]: url
Out[6]: 'https://netloc/path?param=param%27%27value'
In [7]: str(URL(url))
Out[7]: "https://netloc/path?param=param''value" If we pass parsed_url = URL(
r_url, encoded=not self._requote_redirect_url
) which does not unquote In [8]: url
Out[8]: 'https://netloc/path?param=param%27%27value'
In [9]: str(URL(url, encoded=True))
Out[9]: 'https://netloc/path?param=param%27%27value' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanations :)
See the issues we opened in the respective libraries: |
Co-authored-by: Quentin Lhoest <[email protected]>
Show benchmarksPyArrow==6.0.0 Show updated benchmarks!Benchmark: benchmark_array_xd.json
Benchmark: benchmark_getitem_100B.json
Benchmark: benchmark_indices_mapping.json
Benchmark: benchmark_iterating.json
Benchmark: benchmark_map_filter.json
Show updated benchmarks!Benchmark: benchmark_array_xd.json
Benchmark: benchmark_getitem_100B.json
Benchmark: benchmark_indices_mapping.json
Benchmark: benchmark_iterating.json
Benchmark: benchmark_map_filter.json
|
Show benchmarksPyArrow==6.0.0 Show updated benchmarks!Benchmark: benchmark_array_xd.json
Benchmark: benchmark_getitem_100B.json
Benchmark: benchmark_indices_mapping.json
Benchmark: benchmark_iterating.json
Benchmark: benchmark_map_filter.json
Show updated benchmarks!Benchmark: benchmark_array_xd.json
Benchmark: benchmark_getitem_100B.json
Benchmark: benchmark_indices_mapping.json
Benchmark: benchmark_iterating.json
Benchmark: benchmark_map_filter.json
|
The library
aiohttp
performs a requoting of redirection URLs that unquotes the single quotation mark character:%27
=>'
This is a problem for our Hugging Face Hub, which requires exact URL from location header.
Specifically, in the query component of the URL (
https://netloc/path?query
), the value forresponse-content-disposition
contains%27
:and after the requoting, the
%27
characters get unquoted to'
:This PR disables the
aiohttp
requoting of redirection URLs.