Skip to content
Permalink
Browse files
Fix #3000 -- do not add / if there’s a query string
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Mar 26, 2018
1 parent dcd597f commit 09cf2e02095fd8b7a5fdbf08e39e6d884f209e52
Showing with 4 additions and 1 deletion.
  1. +2 −0 CHANGES.txt
  2. +2 −1 nikola/plugins/command/serve.py
@@ -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
@@ -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

0 comments on commit 09cf2e0

Please sign in to comment.