mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-23 10:45:45 +01:00
trim / in url
This commit is contained in:
parent
c4fbc707af
commit
5c965719a2
@ -18,6 +18,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
beegoctx "github.com/astaxie/beego/context"
|
||||
"github.com/vmware/harbor/src/common/models"
|
||||
@ -172,7 +173,7 @@ func (b *basicAuthReqCtxModifier) Modify(ctx *beegoctx.Context) bool {
|
||||
}
|
||||
|
||||
func filterReq(req *http.Request) bool {
|
||||
path := req.URL.Path
|
||||
path := strings.TrimRight(req.URL.Path, "/")
|
||||
if path == "/api/projects" && req.Method == http.MethodPost ||
|
||||
path == "/service/token" && req.Method == http.MethodGet {
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user