Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
dca5b862
Commit
dca5b862
authored
Dec 17, 2010
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Issue9721 - urljoin behavior when the relative url starts with ';'
parent
b25a7918
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
Lib/test/test_urlparse.py
Lib/test/test_urlparse.py
+3
-0
Lib/urllib/parse.py
Lib/urllib/parse.py
+2
-7
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_urlparse.py
View file @
dca5b862
...
...
@@ -327,6 +327,9 @@ class UrlParseTestCase(unittest.TestCase):
#self.checkJoin(RFC3986_BASE, 'http:g','http:g') # strict parser
self
.
checkJoin
(
RFC3986_BASE
,
'http:g'
,
'http://a/b/c/g'
)
#relaxed parser
# Test for issue9721
self
.
checkJoin
(
'http://a/b/c/de'
,
';x'
,
'http://a/b/c/;x'
)
def
test_urljoins
(
self
):
self
.
checkJoin
(
SIMPLE_BASE
,
'g:h'
,
'g:h'
)
self
.
checkJoin
(
SIMPLE_BASE
,
'http:g'
,
'http://a/b/c/g'
)
...
...
Lib/urllib/parse.py
View file @
dca5b862
...
...
@@ -411,14 +411,9 @@ def urljoin(base, url, allow_fragments=True):
if
path
[:
1
]
==
'/'
:
return
_coerce_result
(
urlunparse
((
scheme
,
netloc
,
path
,
params
,
query
,
fragment
)))
if
not
path
:
if
not
path
and
not
params
:
path
=
bpath
if
not
params
:
params
=
bparams
else
:
path
=
path
[:
-
1
]
return
_coerce_result
(
urlunparse
((
scheme
,
netloc
,
path
,
params
,
query
,
fragment
)))
params
=
bparams
if
not
query
:
query
=
bquery
return
_coerce_result
(
urlunparse
((
scheme
,
netloc
,
path
,
...
...
Misc/NEWS
View file @
dca5b862
...
...
@@ -19,6 +19,8 @@ Core and Builtins
Library
-------
- Issue #9721: Fix the behavior of urljoin when the relative url starts with a
';' character. Patch by Wes Chow.
- Issue #10714: Limit length of incoming request in http.server to 65536 bytes
for security reasons. Initial patch by Ross Lagerwall.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment