From ac451c300ec7ae654b0ae1997c4c35a05474947a Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Sat, 2 Oct 2021 12:32:36 -0600 Subject: [PATCH] Only strip seperators from the end of a path Otherwise, we might strip the "root" / off Unix pathes --- pelican/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/server.py b/pelican/server.py index 2000cd34..25c55303 100644 --- a/pelican/server.py +++ b/pelican/server.py @@ -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