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
8c460d52
Kaydet (Commit)
8c460d52
authored
Şub 24, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#1627: httplib now ignores negative Content-Length headers.
üst
23635030
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
httplib.py
Lib/httplib.py
+3
-0
test_httplib.py
Lib/test/test_httplib.py
+7
-0
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/httplib.py
Dosyayı görüntüle @
8c460d52
...
@@ -438,6 +438,9 @@ class HTTPResponse:
...
@@ -438,6 +438,9 @@ class HTTPResponse:
self
.
length
=
int
(
length
)
self
.
length
=
int
(
length
)
except
ValueError
:
except
ValueError
:
self
.
length
=
None
self
.
length
=
None
else
:
if
self
.
length
<
0
:
# ignore nonsensical negative lengths
self
.
length
=
None
else
:
else
:
self
.
length
=
None
self
.
length
=
None
...
...
Lib/test/test_httplib.py
Dosyayı görüntüle @
8c460d52
...
@@ -184,6 +184,13 @@ class BasicTest(TestCase):
...
@@ -184,6 +184,13 @@ class BasicTest(TestCase):
finally
:
finally
:
resp
.
close
()
resp
.
close
()
def
test_negative_content_length
(
self
):
sock
=
FakeSocket
(
'HTTP/1.1 200 OK
\r\n
Content-Length: -1
\r\n\r\n
Hello
\r\n
'
)
resp
=
httplib
.
HTTPResponse
(
sock
,
method
=
"GET"
)
resp
.
begin
()
self
.
assertEquals
(
resp
.
read
(),
'Hello
\r\n
'
)
resp
.
close
()
class
OfflineTest
(
TestCase
):
class
OfflineTest
(
TestCase
):
def
test_responses
(
self
):
def
test_responses
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
8c460d52
...
@@ -441,6 +441,8 @@ Core and builtins
...
@@ -441,6 +441,8 @@ Core and builtins
Library
Library
-------
-------
- #1627: httplib now ignores negative Content-Length headers.
- #900744: If an invalid chunked-encoding header is sent by a server,
- #900744: If an invalid chunked-encoding header is sent by a server,
httplib will now raise IncompleteRead and close the connection instead
httplib will now raise IncompleteRead and close the connection instead
of raising ValueError.
of raising ValueError.
...
...
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