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
b93e4b24
Kaydet (Commit)
b93e4b24
authored
Nis 03, 2016
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #26586: Merge excessive HTTP header handling from 3.5
üst
1862bb27
acc03195
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
server.py
Lib/http/server.py
+7
-0
test_httpservers.py
Lib/test/test_httpservers.py
+7
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/http/server.py
Dosyayı görüntüle @
b93e4b24
...
...
@@ -338,6 +338,13 @@ class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):
HTTPStatus
.
BAD_REQUEST
,
"Line too long"
)
return
False
except
http
.
client
.
HTTPException
as
err
:
self
.
send_error
(
HTTPStatus
.
REQUEST_HEADER_FIELDS_TOO_LARGE
,
"Too many headers"
,
str
(
err
)
)
return
False
conntype
=
self
.
headers
.
get
(
'Connection'
,
""
)
if
conntype
.
lower
()
==
'close'
:
...
...
Lib/test/test_httpservers.py
Dosyayı görüntüle @
b93e4b24
...
...
@@ -859,6 +859,13 @@ class BaseHTTPRequestHandlerTestCase(unittest.TestCase):
self
.
assertFalse
(
self
.
handler
.
get_called
)
self
.
assertEqual
(
self
.
handler
.
requestline
,
'GET / HTTP/1.1'
)
def
test_too_many_headers
(
self
):
result
=
self
.
send_typical_request
(
b
'GET / HTTP/1.1
\r\n
'
+
b
'X-Foo: bar
\r\n
'
*
101
+
b
'
\r\n
'
)
self
.
assertEqual
(
result
[
0
],
b
'HTTP/1.1 431 Too many headers
\r\n
'
)
self
.
assertFalse
(
self
.
handler
.
get_called
)
self
.
assertEqual
(
self
.
handler
.
requestline
,
'GET / HTTP/1.1'
)
def
test_close_connection
(
self
):
# handle_one_request() should be repeatedly called until
# it sets close_connection
...
...
Misc/NEWS
Dosyayı görüntüle @
b93e4b24
...
...
@@ -237,6 +237,10 @@ Core and Builtins
Library
-------
-
Issue
#
26586
:
In
http
.
server
,
respond
with
"413 Request header fields too
large"
if
there
are
too
many
header
fields
to
parse
,
rather
than
killing
the
connection
and
raising
an
unhandled
exception
.
Patch
by
Xiang
Zhang
.
-
Issue
#
26676
:
Added
missing
XMLPullParser
to
ElementTree
.
__all__
.
-
Issue
#
22854
:
Change
BufferedReader
.
writable
()
and
...
...
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