Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #2331 -- fix folder handling/redirects in auto
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed May 5, 2016
1 parent a27143b commit 2928646
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -9,6 +9,7 @@ Features
Bugfixes
--------

* Fix folder handling and redirects in ``nikola auto`` (Issue #2331)
* Use state files in ``nikola github_deploy`` and ``nikola status``
(Issue #2317)
* Add ``align`` options for ``youtube``, ``vimeo``, ``soundcloud``
Expand Down
4 changes: 2 additions & 2 deletions nikola/plugins/command/auto/__init__.py
Expand Up @@ -302,8 +302,8 @@ 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 + '/')])
if not p_uri.path.endswith('/'): # Redirect to avoid breakage
start_response('301 Moved Permanently', [('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 2928646

Please sign in to comment.