mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 01:32:25 -05:00
[feature] Use X-Robots-Tag headers to instruct scrapers/crawlers (#3737)
* [feature] Use `X-Robots-Tag` headers to instruct scrapers/crawlers * use switch for RobotsHeaders
This commit is contained in:
parent
bfb81f5bac
commit
baed591a1d
15 changed files with 311 additions and 142 deletions
|
|
@ -44,12 +44,5 @@ func ExtraHeaders() gin.HandlerFunc {
|
|||
//
|
||||
// See: https://github.com/patcg-individual-drafts/topics
|
||||
c.Header("Permissions-Policy", "browsing-topics=()")
|
||||
|
||||
// Some AI scrapers respect the following tags to opt-out
|
||||
// of their crawling and datasets.
|
||||
c.Header("X-Robots-Tag", "noimageai")
|
||||
// c.Header calls .Set(), but we want to emit the header
|
||||
// twice, not override it.
|
||||
c.Writer.Header().Add("X-Robots-Tag", "noai")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue