From: Sebastian Harl Date: Thu, 4 Dec 2014 21:35:54 +0000 (+0100) Subject: Remove query data from the URI path. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bd793e10aa50a9bdaa0a635ac7711e5c9a4628b8;p=sysdb%2Fwebui.git Remove query data from the URI path. --- 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)