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
72c238e2
Kaydet (Commit)
72c238e2
authored
Eyl 13, 2013
tarafından
Senthil Kumaran
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix http.server's request handling case on trailing '/'.
Patch contributed by Vajrasky Kok. Addresses Issue #17324
üst
016af3f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
server.py
Lib/http/server.py
+4
-0
test_httpservers.py
Lib/test/test_httpservers.py
+3
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/http/server.py
Dosyayı görüntüle @
72c238e2
...
...
@@ -780,6 +780,8 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
# abandon query parameters
path
=
path
.
split
(
'?'
,
1
)[
0
]
path
=
path
.
split
(
'#'
,
1
)[
0
]
# Don't forget explicit trailing slash when normalizing. Issue17324
trailing_slash
=
True
if
path
.
rstrip
()
.
endswith
(
'/'
)
else
False
path
=
posixpath
.
normpath
(
urllib
.
parse
.
unquote
(
path
))
words
=
path
.
split
(
'/'
)
words
=
filter
(
None
,
words
)
...
...
@@ -789,6 +791,8 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
head
,
word
=
os
.
path
.
split
(
word
)
if
word
in
(
os
.
curdir
,
os
.
pardir
):
continue
path
=
os
.
path
.
join
(
path
,
word
)
if
trailing_slash
:
path
+=
'/'
return
path
def
copyfile
(
self
,
source
,
outputfile
):
...
...
Lib/test/test_httpservers.py
Dosyayı görüntüle @
72c238e2
...
...
@@ -249,6 +249,9 @@ class SimpleHTTPServerTestCase(BaseTestCase):
#constructs the path relative to the root directory of the HTTPServer
response
=
self
.
request
(
self
.
tempdir_name
+
'/test'
)
self
.
check_status_and_reason
(
response
,
200
,
data
=
self
.
data
)
# check for trailing "/" which should return 404. See Issue17324
response
=
self
.
request
(
self
.
tempdir_name
+
'/test/'
)
self
.
check_status_and_reason
(
response
,
404
)
response
=
self
.
request
(
self
.
tempdir_name
+
'/'
)
self
.
check_status_and_reason
(
response
,
200
)
response
=
self
.
request
(
self
.
tempdir_name
)
...
...
Misc/NEWS
Dosyayı görüntüle @
72c238e2
...
...
@@ -68,6 +68,10 @@ Core and Builtins
Library
-------
- Issue #17324: Fix http.server'
s
request
handling
case
on
trailing
'/'
.
Patch
contributed
by
Vajrasky
Kok
.
-
Issue
#
18784
:
The
uuid
module
no
more
attempts
to
load
libc
via
ctypes
.
CDLL
,
if
all
necessary
functions
are
already
found
in
libuuid
.
Patch
by
Evgeny
Sologubov
.
...
...
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