diff --git a/integration/get_test.go b/integration/get_test.go index 3666440..cfb7188 100644 --- a/integration/get_test.go +++ b/integration/get_test.go @@ -1,4 +1,5 @@ - +//go:build integration +// +build integration package integration diff --git a/server/upstream/redirects.go b/server/upstream/redirects.go index b0e164d..ab6c971 100644 --- a/server/upstream/redirects.go +++ b/server/upstream/redirects.go @@ -68,8 +68,8 @@ func (o *Options) matchRedirects(ctx *context.Context, giteaClient *gitea.Client for _, redirect := range redirects { reqUrl := ctx.Req.RequestURI // remove repo and branch from request url - reqUrl = strings.TrimPrefix(reqUrl, "/" + o.TargetRepo) - reqUrl = strings.TrimPrefix(reqUrl, "/@" + o.TargetBranch) + reqUrl = strings.TrimPrefix(reqUrl, "/"+o.TargetRepo) + reqUrl = strings.TrimPrefix(reqUrl, "/@"+o.TargetBranch) // check if from url matches request url if strings.TrimSuffix(redirect.From, "/") == strings.TrimSuffix(reqUrl, "/") { @@ -112,6 +112,6 @@ func (o *Options) matchRedirects(ctx *context.Context, giteaClient *gitea.Client } } } - + return false -} \ No newline at end of file +}