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
74a249e1
Kaydet (Commit)
74a249e1
authored
Eyl 14, 2004
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Strip square brackets from IPv6 address.
üst
82d0eecf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
httplib.py
Lib/httplib.py
+2
-0
test_httplib.py
Lib/test/test_httplib.py
+8
-3
No files found.
Lib/httplib.py
Dosyayı görüntüle @
74a249e1
...
@@ -534,6 +534,8 @@ class HTTPConnection:
...
@@ -534,6 +534,8 @@ class HTTPConnection:
host
=
host
[:
i
]
host
=
host
[:
i
]
else
:
else
:
port
=
self
.
default_port
port
=
self
.
default_port
if
host
[
0
]
==
'['
and
host
[
-
1
]
==
']'
:
host
=
host
[
1
:
-
1
]
self
.
host
=
host
self
.
host
=
host
self
.
port
=
port
self
.
port
=
port
...
...
Lib/test/test_httplib.py
Dosyayı görüntüle @
74a249e1
...
@@ -118,12 +118,17 @@ def _test():
...
@@ -118,12 +118,17 @@ def _test():
else
:
else
:
print
"Expect InvalidURL"
print
"Expect InvalidURL"
for
hp
in
(
"[fe80::207:e9ff:fe9b]:8000"
,
"www.python.org:80"
,
for
hp
,
h
,
p
in
((
"[fe80::207:e9ff:fe9b]:8000"
,
"fe80::207:e9ff:fe9b"
,
8000
),
"www.python.org"
,
"[fe80::207:e9ff:fe9b]"
):
(
"www.python.org:80"
,
"www.python.org"
,
80
),
(
"www.python.org"
,
"www.python.org"
,
80
),
(
"[fe80::207:e9ff:fe9b]"
,
"fe80::207:e9ff:fe9b"
,
80
)):
try
:
try
:
h
=
httplib
.
HTTP
(
hp
)
h
ttp
=
httplib
.
HTTP
(
hp
)
except
httplib
.
InvalidURL
:
except
httplib
.
InvalidURL
:
print
"InvalidURL raised erroneously"
print
"InvalidURL raised erroneously"
c
=
http
.
_conn
if
h
!=
c
.
host
:
raise
AssertionError
,
(
"Host incorrectly parsed"
,
h
,
c
.
host
)
if
p
!=
c
.
port
:
raise
AssertionError
,
(
"Port incorrectly parsed"
,
p
,
c
.
host
)
# test response with multiple message headers with the same field name.
# test response with multiple message headers with the same field name.
text
=
(
'HTTP/1.1 200 OK
\r\n
'
text
=
(
'HTTP/1.1 200 OK
\r\n
'
...
...
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