From 12b6cdcd8ce52269be5a1ca8acaae006896808b5 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Thu, 13 Jul 2023 21:27:25 +0200 Subject: [bugfix] Set Vary header correctly on cache-control (#1988) * [bugfix] Set Vary header correctly on cache-control * Prefer activitypub types on AP endpoints * use immutable on file server, vary by range * vary auth on Accept --- internal/api/wellknown.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'internal/api/wellknown.go') diff --git a/internal/api/wellknown.go b/internal/api/wellknown.go index f277ea274..63ca48ef7 100644 --- a/internal/api/wellknown.go +++ b/internal/api/wellknown.go @@ -40,8 +40,11 @@ func (w *WellKnown) Route(r router.Router, m ...gin.HandlerFunc) { // attach middlewares appropriate for this group wellKnownGroup.Use(m...) wellKnownGroup.Use( - // allow .well-known responses to be cached for 2 minutes - middleware.CacheControl("public", "max-age=120"), + // Allow public cache for 2 minutes. + middleware.CacheControl(middleware.CacheControlConfig{ + Directives: []string{"public", "max-age=120"}, + Vary: []string{"Accept-Encoding"}, + }), ) w.nodeInfo.Route(wellKnownGroup.Handle) -- cgit v1.2.3