mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-24 13:56:57 +00:00
fix lint & co
This commit is contained in:
parent
794e497f21
commit
ff0bc0f0ae
2 changed files with 6 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
|
||||
//go:build integration
|
||||
// +build integration
|
||||
|
||||
package integration
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue