This commit is contained in:
6543 2022-11-07 23:01:31 +01:00
parent a03ea956d5
commit 218b52094e
No known key found for this signature in database
GPG key ID: B8BE6D610E61C862
3 changed files with 5 additions and 4 deletions

View file

@ -46,7 +46,7 @@ func Handler(mainDomainSuffix, rawDomain string,
trimmedHost := utils.TrimHostPort(req.Host)
// Add HSTS for RawDomain and MainDomainSuffix
if hsts := GetHSTSHeader(trimmedHost, mainDomainSuffix, rawDomain); hsts != "" {
if hsts := getHSTSHeader(trimmedHost, mainDomainSuffix, rawDomain); hsts != "" {
ctx.RespWriter.Header().Set("Strict-Transport-Security", hsts)
}
@ -92,6 +92,7 @@ func Handler(mainDomainSuffix, rawDomain string,
// tryBranch checks if a branch exists and populates the target variables. If canonicalLink is non-empty, it will
// also disallow search indexing and add a Link header to the canonical URL.
// TODO: move into external func to not alert vars indirectly
tryBranch := func(log zerolog.Logger, repo, branch string, _path []string, canonicalLink string) bool {
if repo == "" {
log.Debug().Msg("tryBranch: repo == ''")