Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
d537ab0f
Unverified
Kaydet (Commit)
d537ab0f
authored
Nis 30, 2019
tarafından
Steve Dower
Kaydeden (comit)
GitHub
Nis 30, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-36742: Fixes handling of pre-normalization characters in urlsplit() (GH-13017)
üst
b84cb708
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
test_urlparse.py
Lib/test/test_urlparse.py
+6
-0
parse.py
Lib/urllib/parse.py
+7
-4
2019-04-29-15-34-59.bpo-36742.QCUY0i.rst
....d/next/Security/2019-04-29-15-34-59.bpo-36742.QCUY0i.rst
+1
-0
No files found.
Lib/test/test_urlparse.py
Dosyayı görüntüle @
d537ab0f
...
...
@@ -1011,6 +1011,12 @@ class UrlParseTestCase(unittest.TestCase):
self
.
assertIn
(
'
\u2100
'
,
denorm_chars
)
self
.
assertIn
(
'
\uFF03
'
,
denorm_chars
)
# bpo-36742: Verify port separators are ignored when they
# existed prior to decomposition
urllib
.
parse
.
urlsplit
(
'http://
\u30d5\u309a
:80'
)
with
self
.
assertRaises
(
ValueError
):
urllib
.
parse
.
urlsplit
(
'http://
\u30d5\u309a\ufe13
80'
)
for
scheme
in
[
"http"
,
"https"
,
"ftp"
]:
for
c
in
denorm_chars
:
url
=
"{}://netloc{}false.netloc/path"
.
format
(
scheme
,
c
)
...
...
Lib/urllib/parse.py
Dosyayı görüntüle @
d537ab0f
...
...
@@ -402,13 +402,16 @@ def _checknetloc(netloc):
# looking for characters like \u2100 that expand to 'a/c'
# IDNA uses NFKC equivalence, so normalize for this check
import
unicodedata
netloc2
=
unicodedata
.
normalize
(
'NFKC'
,
netloc
)
if
netloc
==
netloc2
:
n
=
netloc
.
rpartition
(
'@'
)[
2
]
# ignore anything to the left of '@'
n
=
n
.
replace
(
':'
,
''
)
# ignore characters already included
n
=
n
.
replace
(
'#'
,
''
)
# but not the surrounding text
n
=
n
.
replace
(
'?'
,
''
)
netloc2
=
unicodedata
.
normalize
(
'NFKC'
,
n
)
if
n
==
netloc2
:
return
_
,
_
,
netloc
=
netloc
.
rpartition
(
'@'
)
# anything to the left of '@' is okay
for
c
in
'/?#@:'
:
if
c
in
netloc2
:
raise
ValueError
(
"netloc '"
+
netloc
2
+
"' contains invalid "
+
raise
ValueError
(
"netloc '"
+
netloc
+
"' contains invalid "
+
"characters under NFKC normalization"
)
def
urlsplit
(
url
,
scheme
=
''
,
allow_fragments
=
True
):
...
...
Misc/NEWS.d/next/Security/2019-04-29-15-34-59.bpo-36742.QCUY0i.rst
0 → 100644
Dosyayı görüntüle @
d537ab0f
Fixes mishandling of pre-normalization characters in urlsplit().
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