mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-25 06:16:58 +00:00
wip
This commit is contained in:
parent
7f2854d537
commit
05e075dd83
5 changed files with 25 additions and 23 deletions
|
@ -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\"",
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue