mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-104049: do not expose on-disk location from SimpleHTTPRequestHandler (#104067)
Do not expose the local server's on-disk location from `SimpleHTTPRequestHandler` when generating a directory index. (unnecessary information disclosure) --------- Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
292076a9aa
commit
c7c3a60c88
3 changed files with 11 additions and 1 deletions
|
@ -791,7 +791,7 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
|
|||
displaypath = urllib.parse.unquote(self.path,
|
||||
errors='surrogatepass')
|
||||
except UnicodeDecodeError:
|
||||
displaypath = urllib.parse.unquote(path)
|
||||
displaypath = urllib.parse.unquote(self.path)
|
||||
displaypath = html.escape(displaypath, quote=False)
|
||||
enc = sys.getfilesystemencoding()
|
||||
title = f'Directory listing for {displaypath}'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue