code format

This commit is contained in:
6543 2021-12-09 20:16:43 +01:00
parent 70c7065f76
commit 6af6523a0f
No known key found for this signature in database
GPG key ID: C99B82E40B027BAE
2 changed files with 6 additions and 6 deletions

View file

@ -29,7 +29,7 @@ func tryUpstream(ctx *fasthttp.RequestCtx,
if targetRepo != "pages" {
path := strings.SplitN(canonicalPath, "/", 3)
if len(path) >= 3 {
canonicalPath = "/" + strings.SplitN(canonicalPath, "/", 3)[2]
canonicalPath = "/" + path[2]
}
}
ctx.Redirect("https://"+canonicalDomain+canonicalPath, fasthttp.StatusTemporaryRedirect)