Merge pull request #2774 from ywk253100/170713_integration

Trim last / in url
This commit is contained in:
Wenkai Yin 2017-07-19 10:15:05 +08:00 committed by GitHub
commit 6e10a21871

View File

@ -18,6 +18,7 @@ import (
"context"
"fmt"
"net/http"
"strings"
beegoctx "github.com/astaxie/beego/context"
"github.com/vmware/harbor/src/common/models"
@ -177,7 +178,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