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
ca897e96
Kaydet (Commit)
ca897e96
authored
Kas 02, 2011
tarafından
Ezio Melotti
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#13295: http.server now produces valid HTML 4.01 strict.
üst
23e275b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
server.py
Lib/http/server.py
+14
-8
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/http/server.py
Dosyayı görüntüle @
ca897e96
...
@@ -105,6 +105,7 @@ import copy
...
@@ -105,6 +105,7 @@ import copy
DEFAULT_ERROR_MESSAGE
=
"""
\
DEFAULT_ERROR_MESSAGE
=
"""
\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Error response</title>
<title>Error response</title>
...
@@ -734,10 +735,16 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
...
@@ -734,10 +735,16 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
list
.
sort
(
key
=
lambda
a
:
a
.
lower
())
list
.
sort
(
key
=
lambda
a
:
a
.
lower
())
r
=
[]
r
=
[]
displaypath
=
html
.
escape
(
urllib
.
parse
.
unquote
(
self
.
path
))
displaypath
=
html
.
escape
(
urllib
.
parse
.
unquote
(
self
.
path
))
r
.
append
(
'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'
)
enc
=
sys
.
getfilesystemencoding
()
r
.
append
(
"<html>
\n
<title>Directory listing for
%
s</title>
\n
"
%
displaypath
)
title
=
'Directory listing for
%
s'
%
displaypath
r
.
append
(
"<body>
\n
<h2>Directory listing for
%
s</h2>
\n
"
%
displaypath
)
r
.
append
(
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" '
r
.
append
(
"<hr>
\n
<ul>
\n
"
)
'"http://www.w3.org/TR/html4/strict.dtd">'
)
r
.
append
(
'<html>
\n
<head>'
)
r
.
append
(
'<meta http-equiv="Content-Type" '
'content="text/html; charset=
%
s">'
%
enc
)
r
.
append
(
'<title>
%
s</title>
\n
</head>'
%
title
)
r
.
append
(
'<body>
\n
<h1>
%
s</h1>'
%
title
)
r
.
append
(
'<hr>
\n
<ul>'
)
for
name
in
list
:
for
name
in
list
:
fullname
=
os
.
path
.
join
(
path
,
name
)
fullname
=
os
.
path
.
join
(
path
,
name
)
displayname
=
linkname
=
name
displayname
=
linkname
=
name
...
@@ -748,11 +755,10 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
...
@@ -748,11 +755,10 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
if
os
.
path
.
islink
(
fullname
):
if
os
.
path
.
islink
(
fullname
):
displayname
=
name
+
"@"
displayname
=
name
+
"@"
# Note: a link to a directory displays with @ and links with /
# Note: a link to a directory displays with @ and links with /
r
.
append
(
'<li><a href="
%
s">
%
s</a>
\n
'
r
.
append
(
'<li><a href="
%
s">
%
s</a>
</li>
'
%
(
urllib
.
parse
.
quote
(
linkname
),
html
.
escape
(
displayname
)))
%
(
urllib
.
parse
.
quote
(
linkname
),
html
.
escape
(
displayname
)))
r
.
append
(
"</ul>
\n
<hr>
\n
</body>
\n
</html>
\n
"
)
r
.
append
(
'</ul>
\n
<hr>
\n
</body>
\n
</html>
\n
'
)
enc
=
sys
.
getfilesystemencoding
()
encoded
=
'
\n
'
.
join
(
r
)
.
encode
(
enc
)
encoded
=
''
.
join
(
r
)
.
encode
(
enc
)
f
=
io
.
BytesIO
()
f
=
io
.
BytesIO
()
f
.
write
(
encoded
)
f
.
write
(
encoded
)
f
.
seek
(
0
)
f
.
seek
(
0
)
...
...
Misc/NEWS
Dosyayı görüntüle @
ca897e96
...
@@ -350,6 +350,8 @@ Core and Builtins
...
@@ -350,6 +350,8 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
13295
:
http
.
server
now
produces
valid
HTML
4.01
strict
.
-
Issue
#
2892
:
preserve
iterparse
events
in
case
of
SyntaxError
.
-
Issue
#
2892
:
preserve
iterparse
events
in
case
of
SyntaxError
.
-
Issue
#
13287
:
urllib
.
request
and
urllib
.
error
now
contains
a
__all__
and
-
Issue
#
13287
:
urllib
.
request
and
urllib
.
error
now
contains
a
__all__
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