Merge branch 'master' into refactoring

This commit is contained in:
6543 2021-12-05 22:50:46 +01:00
commit 5aae7c882f
No known key found for this signature in database
GPG Key ID: C99B82E40B027BAE
1 changed files with 1 additions and 1 deletions

View File

@ -114,7 +114,7 @@ func (o *Options) Upstream(ctx *fasthttp.RequestCtx, giteaRoot, giteaAPIToken st
}
// compatibility fix for GitHub Pages (/example → /example.html)
optionsForIndexPages.appendTrailingSlash = false
optionsForIndexPages.redirectIfExists = string(ctx.Request.URI().Path()) + ".html"
optionsForIndexPages.redirectIfExists = strings.TrimSuffix(string(ctx.Request.URI().Path()), "/") + ".html"
optionsForIndexPages.TargetPath = o.TargetPath + ".html"
if optionsForIndexPages.Upstream(ctx, giteaRoot, giteaAPIToken, branchTimestampCache, fileResponseCache) {
_ = fileResponseCache.Set(uri+"?timestamp="+strconv.FormatInt(o.BranchTimestamp.Unix(), 10), fileResponse{