Skip to content

Commit

Permalink
Fix #3000 -- do not add / if there’s a query string
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 26, 2018
1 parent dcd597f commit 09cf2e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES.txt
Expand Up @@ -38,6 +38,8 @@ Features
Bugfixes
--------

* Do not redirect with added slash if query string is in URL handled
by ``nikola serve`` (Issue #3000)
* Fix w3c validation errors for itemscope entries in default themes
* Hide “Incomplete language” message for overrides of complete
languages
Expand Down
3 changes: 2 additions & 1 deletion nikola/plugins/command/serve.py
Expand Up @@ -214,8 +214,9 @@ def send_head(self):
path = self.translate_path(self.path)
f = None
if os.path.isdir(path):
if not self.path.endswith('/'):
if not self.path.endswith('/') and '?' not in self.path:
# redirect browser - doing basically what apache does
# - but not if there is a query string (Issue #3000)
self.send_response(301)
self.send_header("Location", self.path + "/")
# begin no-cache patch
Expand Down

0 comments on commit 09cf2e0

Please sign in to comment.