From b5c313a5107fbc65069b5cb1b14f4fab611469fb Mon Sep 17 00:00:00 2001 From: Abhinav Singh Date: Wed, 4 Sep 2024 00:20:08 +0000 Subject: [PATCH] fix: [CODE-2314]: check / at end to for routing (#2612) * fix: [CODE-2314]: check / at end to for routing --- app/router/api_router.go | 2 +- app/router/git_router.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/router/api_router.go b/app/router/api_router.go index 2aa86450a..c08ea5231 100644 --- a/app/router/api_router.go +++ b/app/router/api_router.go @@ -50,7 +50,7 @@ func (r *APIRouter) Handle(w http.ResponseWriter, req *http.Request) { func (r *APIRouter) IsEligibleTraffic(req *http.Request) bool { // All Rest API calls start with "/api/", and thus can be uniquely identified. p := req.URL.Path - return strings.HasPrefix(p, APIMount) + return strings.HasPrefix(p, APIMount+"/") } func (r *APIRouter) Name() string { diff --git a/app/router/git_router.go b/app/router/git_router.go index 745357f01..d7ff814fc 100644 --- a/app/router/git_router.go +++ b/app/router/git_router.go @@ -53,7 +53,7 @@ func (r *GitRouter) IsEligibleTraffic(req *http.Request) bool { // git traffic is always reachable via the git mounting path. p := req.URL.Path - if strings.HasPrefix(p, GitMount) { + if strings.HasPrefix(p, GitMount+"/") { return true }