pull/18/head
6543 2021-12-09 19:32:30 +01:00
rodzic aa0638903a
commit 70c7065f76
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: C99B82E40B027BAE
1 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

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