fix: prefix service path with '/' if missing
This commit is contained in:
parent
16ea60f2aa
commit
d0f5277bf4
|
@ -66,6 +66,9 @@ func (s *Server) ServeHTTP(res http.ResponseWriter, req *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
servicePath := strings.Join(apiRequest.URI[:pathIndex], "/")
|
servicePath := strings.Join(apiRequest.URI[:pathIndex], "/")
|
||||||
|
if !strings.HasPrefix(servicePath, "/") {
|
||||||
|
servicePath = "/" + servicePath
|
||||||
|
}
|
||||||
|
|
||||||
// 3. check if matching methodDef exists in config */
|
// 3. check if matching methodDef exists in config */
|
||||||
var methodDef = serviceDef.Method(req.Method)
|
var methodDef = serviceDef.Method(req.Method)
|
||||||
|
|
Loading…
Reference in New Issue