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/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/api/client.go') diff --git a/internal/api/client.go b/internal/api/client.go index 59fa0cf96..d9f131e3b 100644 --- a/internal/api/client.go +++ b/internal/api/client.go @@ -83,7 +83,10 @@ func (c *Client) Route(r router.Router, m ...gin.HandlerFunc) { apiGroup.Use(m...) apiGroup.Use( middleware.TokenCheck(c.db, c.processor.OAuthValidateBearerToken), - middleware.CacheControl("no-store"), // never cache api responses + middleware.CacheControl(middleware.CacheControlConfig{ + // Never cache client api responses. + Directives: []string{"no-store"}, + }), ) // for each client api module, pass it the Handle function -- cgit v1.2.3