Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-04-12 20:18:54 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-04-12 20:18:54 +0300
commitee67dbeff5bae6941facaaa39cb995a1ee6def03 (patch)
tree3ba0985d48b07a6832134377edb89ff36edbd980 /commands
parent4a3f2427ed35e304ff72cd0208bf0e4f428d42a4 (diff)
Fix query parameter handling in server fast render mode
There may be a simpler way to get to the raw path, but this will have to do for now. Fixes #7163
Diffstat (limited to 'commands')
-rw-r--r--commands/server.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/commands/server.go b/commands/server.go
index f81708615..f8370107f 100644
--- a/commands/server.go
+++ b/commands/server.go
@@ -361,7 +361,8 @@ func (f *fileServer) createEndpoint(i int) (*http.ServeMux, string, string, erro
}
if f.c.fastRenderMode && f.c.buildErr == nil {
- p := r.RequestURI
+
+ p := strings.TrimSuffix(r.RequestURI, "?"+r.URL.RawQuery)
if strings.HasSuffix(p, "/") || strings.HasSuffix(p, "html") || strings.HasSuffix(p, "htm") {
if !f.c.visitedURLs.Contains(p) {
// If not already on stack, re-render that single page.