Skip to content

Commit

Permalink
Tweaks previous change to correct a slight oversight
Browse files Browse the repository at this point in the history
  • Loading branch information
sbeus committed Feb 20, 2024
1 parent 691230e commit ab13624
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab13624

Please sign in to comment.