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