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
791ac54a
Kaydet (Commit)
791ac54a
authored
Nis 18, 2016
tarafından
Martin Panter
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #26657: Merge http.server fix from 3.5
üst
d2be07e1
d274b3f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
3 deletions
+26
-3
server.py
Lib/http/server.py
+3
-3
test_httpservers.py
Lib/test/test_httpservers.py
+19
-0
NEWS
Misc/NEWS
+4
-0
No files found.
Lib/http/server.py
Dosyayı görüntüle @
791ac54a
...
...
@@ -768,9 +768,9 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
words
=
filter
(
None
,
words
)
path
=
os
.
getcwd
()
for
word
in
words
:
drive
,
word
=
os
.
path
.
splitdrive
(
word
)
head
,
word
=
os
.
path
.
split
(
word
)
if
word
in
(
os
.
curdir
,
os
.
pardir
):
continue
if
os
.
path
.
dirname
(
word
)
or
word
in
(
os
.
curdir
,
os
.
pardir
):
# Ignore components that are not a simple file/directory name
continue
path
=
os
.
path
.
join
(
path
,
word
)
if
trailing_slash
:
path
+=
'/'
...
...
Lib/test/test_httpservers.py
Dosyayı görüntüle @
791ac54a
...
...
@@ -12,6 +12,7 @@ import os
import
sys
import
re
import
base64
import
ntpath
import
shutil
import
urllib.parse
import
html
...
...
@@ -960,6 +961,24 @@ class SimpleHTTPRequestHandlerTestCase(unittest.TestCase):
path
=
self
.
handler
.
translate_path
(
'//filename?foo=bar'
)
self
.
assertEqual
(
path
,
self
.
translated
)
def
test_windows_colon
(
self
):
with
support
.
swap_attr
(
server
.
os
,
'path'
,
ntpath
):
path
=
self
.
handler
.
translate_path
(
'c:c:c:foo/filename'
)
path
=
path
.
replace
(
ntpath
.
sep
,
os
.
sep
)
self
.
assertEqual
(
path
,
self
.
translated
)
path
=
self
.
handler
.
translate_path
(
'
\\
c:../filename'
)
path
=
path
.
replace
(
ntpath
.
sep
,
os
.
sep
)
self
.
assertEqual
(
path
,
self
.
translated
)
path
=
self
.
handler
.
translate_path
(
'c:
\\
c:..
\\
foo/filename'
)
path
=
path
.
replace
(
ntpath
.
sep
,
os
.
sep
)
self
.
assertEqual
(
path
,
self
.
translated
)
path
=
self
.
handler
.
translate_path
(
'c:c:foo
\\
c:c:bar/filename'
)
path
=
path
.
replace
(
ntpath
.
sep
,
os
.
sep
)
self
.
assertEqual
(
path
,
self
.
translated
)
class
MiscTestCase
(
unittest
.
TestCase
):
def
test_all
(
self
):
...
...
Misc/NEWS
Dosyayı görüntüle @
791ac54a
...
...
@@ -245,6 +245,10 @@ Core and Builtins
Library
-------
-
Issue
#
26657
:
Fix
directory
traversal
vulnerability
with
http
.
server
on
Windows
.
This
fixes
a
regression
that
was
introduced
in
3.3.4
rc1
and
3.4.0
rc1
.
Based
on
patch
by
Philipp
Hagemeister
.
-
Issue
#
26717
:
Stop
encoding
Latin
-
1
-
ized
WSGI
paths
with
UTF
-
8.
Patch
by
Anthony
Sottile
.
...
...
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