This commit is contained in:
6543 2022-11-11 05:21:05 +01:00
parent 7f2854d537
commit 05e075dd83
No known key found for this signature in database
GPG key ID: B8BE6D610E61C862
5 changed files with 25 additions and 23 deletions

View file

@ -119,8 +119,8 @@ func Handler(mainDomainSuffix, rawDomain string,
if canonicalLink != "" {
// Hide from search machines & add canonical link
ctx.Response().Header.Set("X-Robots-Tag", "noarchive, noindex")
ctx.Response().Header.Set("Link",
ctx.RespWriter.Header().Set("X-Robots-Tag", "noarchive, noindex")
ctx.RespWriter.Header().Set("Link",
strings.NewReplacer("%b", targetBranch, "%p", targetPath).Replace(canonicalLink)+
"; rel=\"canonical\"",
)