diff options
author | 2025-02-05 12:47:13 +0100 | |
---|---|---|
committer | 2025-02-05 12:47:13 +0100 | |
commit | baed591a1d19942ec553baed41a8048ab9dd18ca (patch) | |
tree | b8c91d4f193ab2a80e71f222fb1bda4bb775805b /internal/api/wellknown/webfinger/webfinger.go | |
parent | [bugfix] wrong nodeinfo version (tobi is a boob) (#3735) (diff) | |
download | gotosocial-baed591a1d19942ec553baed41a8048ab9dd18ca.tar.xz |
[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
Diffstat (limited to 'internal/api/wellknown/webfinger/webfinger.go')
-rw-r--r-- | internal/api/wellknown/webfinger/webfinger.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/api/wellknown/webfinger/webfinger.go b/internal/api/wellknown/webfinger/webfinger.go index a50013b32..c70afab9d 100644 --- a/internal/api/wellknown/webfinger/webfinger.go +++ b/internal/api/wellknown/webfinger/webfinger.go @@ -21,6 +21,7 @@ import ( "net/http" "github.com/gin-gonic/gin" + "github.com/superseriousbusiness/gotosocial/internal/middleware" "github.com/superseriousbusiness/gotosocial/internal/processing" ) @@ -41,5 +42,6 @@ func New(processor *processing.Processor) *Module { } func (m *Module) Route(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes) { - attachHandler(http.MethodGet, WebfingerBasePath, m.WebfingerGETRequest) + // Attach handler, injecting robots http header middleware to disallow all. + attachHandler(http.MethodGet, WebfingerBasePath, middleware.RobotsHeaders(""), m.WebfingerGETRequest) } |