From bd793e10aa50a9bdaa0a635ac7711e5c9a4628b8 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 4 Dec 2014 22:35:54 +0100 Subject: [PATCH] Remove query data from the URI path. --- server/server.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/server.go b/server/server.go index c0f449c..2b0c27e 100644 --- a/server/server.go +++ b/server/server.go @@ -147,6 +147,9 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { if len(path) > 0 && path[0] == '/' { path = path[1:] } + if idx := strings.Index(path, "?"); idx != -1 { + path = path[:idx] + } var fields []string for _, f := range strings.Split(path, "/") { f, err := url.QueryUnescape(f) -- 2.30.2