-
-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
gh-67693: Fix urlunparse() and urlunsplit() for URIs with path starting with multiple slashes and no authority #113563
Conversation
…ltiple slashes and no authority.
It fixes also more serious security issue #67693. |
b54b670
to
26951a7
Compare
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.
The code changes and tests look good to me.
('//path/to/file', | ||
('', 'path', '/to/file', '', '', ''), | ||
('', 'path', '/to/file', '', '')), | ||
('////path/to/file', |
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.
This case was broken.
('scheme://path/to/file', | ||
('scheme', 'path', '/to/file', '', '', ''), | ||
('scheme', 'path', '/to/file', '', '')), | ||
('scheme:////path/to/file', |
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.
This case was broken.
('file:///tmp/junk.txt', | ||
('file', '', '/tmp/junk.txt', '', '', ''), | ||
('file', '', '/tmp/junk.txt', '', '')), | ||
('file:////tmp/junk.txt', |
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.
This case was broken.
('file:////tmp/junk.txt', | ||
('file', '', '//tmp/junk.txt', '', '', ''), | ||
('file', '', '//tmp/junk.txt', '', '')), | ||
('file://///tmp/junk.txt', |
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.
This case was broken.
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.
LGTM!
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13. |
GH-119025 is a backport of this pull request to the 3.11 branch. |
GH-119026 is a backport of this pull request to the 3.10 branch. |
…h path starting with multiple slashes and no authority (pythonGH-113563) (cherry picked from commit e237b25) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-119027 is a backport of this pull request to the 3.9 branch. |
… path starting with multiple slashes and no authority (pythonGH-113563) (cherry picked from commit e237b25) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
GH-119028 is a backport of this pull request to the 3.8 branch. |
…h path starting with multiple slashes and no authority (pythonGH-113563) (cherry picked from commit e237b25) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
There was a behavioural change to `urllib.parse.urlunparse`[1] that affects some of our tests on Windows. With the understanding that the new behaviour is indeed desired, split up some tests relying on this behaviour depending on the version of Python. This currently affects only 3.12 and 3.13 but there are other backports for that change in review upstream, so we'll likely need to update this in the future. [1] python/cpython#113563
There was a behavioural change to `urllib.parse.urlunparse`[1] that affects some of our tests on Windows. With the understanding that the new behaviour is indeed desired, split up some tests relying on this behaviour depending on the version of Python. This currently affects only 3.12 and 3.13 but there are other backports for that change in review upstream, so we'll likely need to update this in the future. [1] python/cpython#113563
There was a behavioural change to `urllib.parse.urlunparse`[1] that affects some of our tests on Windows. With the understanding that the new behaviour is indeed desired, split up some tests relying on this behaviour depending on the version of Python. This currently affects only 3.12 and 3.13 but there are other backports for that change in review upstream, so we'll likely need to update this in the future. [1] python/cpython#113563
There was a behavioural change to `urllib.parse.urlunparse`[1] that affects some of our tests on Windows. With the understanding that the new behaviour is indeed desired, split up some tests relying on this behaviour depending on the version of Python. This currently affects only 3.12 and 3.13 but there are other backports for that change in review upstream, so we'll likely need to update this in the future. [1] python/cpython#113563
There was a behavioural change to `urllib.parse.urlunparse`[1] that affects some of our tests on Windows. With the understanding that the new behaviour is indeed desired, split up some tests relying on this behaviour depending on the version of Python. The sample URL used to check this behaviour was taken from a test in the upstream change (with the new behaviour this URL will round-trip parsing) [1] python/cpython#113563
There was a behavioural change to `urllib.parse.urlunparse`[1] that affects some of our tests on Windows. With the understanding that the new behaviour is indeed desired, split up some tests relying on this behaviour depending on the version of Python. The sample URL used to check this behaviour was taken from a test in the upstream change (with the new behaviour this URL will round-trip parsing) [1] python/cpython#113563
…starting with multiple slashes and no authority (pythonGH-113563)
Based on #15297.
Co-authored-by: Ashwin Ramaswami aramaswamis@gmail.com