mirror of
https://github.com/python/cpython.git
synced 2025-09-20 15:40:32 +00:00
Patch #1360443: Make SimpleHTTPServer display unencoded directory names.
This commit is contained in:
parent
08caadcce3
commit
6ee6952eb2
1 changed files with 3 additions and 2 deletions
|
@ -103,8 +103,9 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||||
return None
|
return None
|
||||||
list.sort(key=lambda a: a.lower())
|
list.sort(key=lambda a: a.lower())
|
||||||
f = StringIO()
|
f = StringIO()
|
||||||
f.write("<title>Directory listing for %s</title>\n" % self.path)
|
displaypath = cgi.escape(urllib.unquote(self.path))
|
||||||
f.write("<h2>Directory listing for %s</h2>\n" % self.path)
|
f.write("<title>Directory listing for %s</title>\n" % displaypath)
|
||||||
|
f.write("<h2>Directory listing for %s</h2>\n" % displaypath)
|
||||||
f.write("<hr>\n<ul>\n")
|
f.write("<hr>\n<ul>\n")
|
||||||
for name in list:
|
for name in list:
|
||||||
fullname = os.path.join(path, name)
|
fullname = os.path.join(path, name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue