mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Only strip seperators from the end of a path
Otherwise, we might strip the "root" / off Unix pathes
This commit is contained in:
parent
1b52185ece
commit
ac451c300e
1 changed files with 1 additions and 1 deletions
|
|
@ -92,7 +92,7 @@ class ComplexHTTPRequestHandler(server.SimpleHTTPRequestHandler):
|
|||
"""Guess at the mime type for the specified file.
|
||||
"""
|
||||
# strip trailing slash
|
||||
path = path.rstrip().strip("/").strip(os.sep)
|
||||
path = path.rstrip().rstrip("/").rstrip(os.sep)
|
||||
mimetype = super().guess_type(path)
|
||||
|
||||
# If the default guess is too generic, try the python-magic library
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue