diff --git a/pelican/server.py b/pelican/server.py index 6ebce8760..25c55303b 100644 --- a/pelican/server.py +++ b/pelican/server.py @@ -91,7 +91,9 @@ def get_path_that_exists(self, original_path): def guess_type(self, path): """Guess at the mime type for the specified file. """ - mimetype = server.SimpleHTTPRequestHandler.guess_type(self, path) + # strip trailing slash + path = path.rstrip().rstrip("/").rstrip(os.sep) + mimetype = super().guess_type(path) # If the default guess is too generic, try the python-magic library if mimetype == 'application/octet-stream' and magic_from_file: