diff options
Diffstat (limited to 'internal/web/web.go')
| -rw-r--r-- | internal/web/web.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/web/web.go b/internal/web/web.go index ab440ab2f..e42dc16c3 100644 --- a/internal/web/web.go +++ b/internal/web/web.go @@ -99,12 +99,16 @@ func (m *Module) Route(r *router.Router, mi ...gin.HandlerFunc) { // Handlers that serve profiles and statuses should use // the SignatureCheck middleware, so that requests with - // content-type application/activity+json can be served + // content-type application/activity+json can be served, + // and (if enabled) the nollamas middleware, to protect + // against scraping by shitty LLM bullshit. profileGroup := r.AttachGroup(profileGroupPath) profileGroup.Use(mi...) profileGroup.Use(middleware.SignatureCheck(m.isURIBlocked), middleware.CacheControl(middleware.CacheControlConfig{ Directives: []string{"no-store"}, })) + nollamas := middleware.NoLLaMas(m.processor.InstanceGetV1) + profileGroup.Use(nollamas) profileGroup.Handle(http.MethodGet, "", m.profileGETHandler) // use empty path here since it's the base of the group profileGroup.Handle(http.MethodGet, statusPath, m.threadGETHandler) |
