Navigation Menu

Skip to content

Commit

Permalink
redirect on missing trailing / in auto mode (Fix #1933)
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Aug 7, 2015
1 parent 412223e commit 14947d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nikola/plugins/command/auto/__init__.py
Expand Up @@ -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'

Expand Down

0 comments on commit 14947d9

Please sign in to comment.