From ab136244077ea6005718f25fe569be437a02c1f8 Mon Sep 17 00:00:00 2001 From: Sherman Beus Date: Tue, 20 Feb 2024 11:53:09 -0800 Subject: [PATCH] Tweaks previous change to correct a slight oversight --- http/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/http/server.go b/http/server.go index bde6e6d..649f91f 100644 --- a/http/server.go +++ b/http/server.go @@ -405,8 +405,8 @@ func (s *Server) routeCheckMapping(w http.ResponseWriter, r *http.Request) { } path := reqBody.ExamplePath root := strings.TrimSuffix(strings.TrimSuffix(reqBody.RootPath, "/"), `\`) - if strings.HasPrefix(path, root) { - path = path[len(reqBody.RootPath)+1:] + if strings.HasPrefix(path, root) && path != root { + path = path[len(root)+1:] } mappedPath := pathMapper.Translate(path) var respJSON []byte