Skip to content
Permalink
Browse files

redirect on missing trailing / in auto mode (Fix #1933)

  • Loading branch information
ralsina committed Aug 7, 2015
1 parent 412223e commit 14947d91ad1b5e1470fa653a0c07a525e7555afb
Showing with 3 additions and 0 deletions.
  1. +3 −0 nikola/plugins/command/auto/__init__.py
@@ -293,6 +293,9 @@ def serve_static(self, environ, start_response):
mimetype = 'text/html' if uri.endswith('/') else mimetypes.guess_type(uri)[0] or 'application/octet-stream'

if os.path.isdir(f_path):
if not f_path.endswith('/'): # Redirect to avoid breakage
start_response('301 Redirect', [('Location', p_uri.path + '/')])
return []
f_path = os.path.join(f_path, self.site.config['INDEX_FILE'])
mimetype = 'text/html'

0 comments on commit 14947d9

Please sign in to comment.
You can’t perform that action at this time.