fix: [CODE-2314]: check / at end to for routing (#2612)

* fix: [CODE-2314]: check / at end to for routing
This commit is contained in:
Abhinav Singh 2024-09-04 00:20:08 +00:00 committed by Harness
parent 905b4e5d37
commit b5c313a510
2 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ func (r *APIRouter) Handle(w http.ResponseWriter, req *http.Request) {
func (r *APIRouter) IsEligibleTraffic(req *http.Request) bool { func (r *APIRouter) IsEligibleTraffic(req *http.Request) bool {
// All Rest API calls start with "/api/", and thus can be uniquely identified. // All Rest API calls start with "/api/", and thus can be uniquely identified.
p := req.URL.Path p := req.URL.Path
return strings.HasPrefix(p, APIMount) return strings.HasPrefix(p, APIMount+"/")
} }
func (r *APIRouter) Name() string { func (r *APIRouter) Name() string {

View File

@ -53,7 +53,7 @@ func (r *GitRouter) IsEligibleTraffic(req *http.Request) bool {
// git traffic is always reachable via the git mounting path. // git traffic is always reachable via the git mounting path.
p := req.URL.Path p := req.URL.Path
if strings.HasPrefix(p, GitMount) { if strings.HasPrefix(p, GitMount+"/") {
return true return true
} }