mirror of
https://github.com/harness/drone.git
synced 2025-05-19 02:20:03 +08:00
fix: [CODE-2314]: check / at end to for routing (#2612)
* fix: [CODE-2314]: check / at end to for routing
This commit is contained in:
parent
905b4e5d37
commit
b5c313a510
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user