You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browser reloads of mashlib-rendered RDF resources sometimes showed the
raw Turtle/JSON-LD body instead of the mashlib data-browser view.
Root cause: three different code paths set different Vary values for
variants of the same URL:
- mashlib HTML wrapper: "Accept"
- getVaryHeader (Turtle/JSON-LD via conneg): "Accept, Origin"
- getResponseHeaders (default): "Accept, Authorization, Origin"
Chromium/Brave's HTTP cache gets confused by Vary mismatches across
variants and can serve the cached Turtle body on top-level navigation —
the browser then renders it as text. Hard refresh bypasses the cache,
which is why it always worked.
Fix:
- getVaryHeader is the single source of truth. It always emits
"Accept, Authorization, Origin" (when mashlib or conneg is on)
or "Authorization, Origin" otherwise. Authorization is correct
because WAC lets responses vary by authenticated user.
- getResponseHeaders / getAllHeaders / getNotFoundHeaders accept
mashlibEnabled and route through getVaryHeader.
- All headers['Vary'] = 'Accept' overrides in handlers are replaced
with the centralized helper.
- RDF data variants now carry Cache-Control:
"private, no-cache, must-revalidate". ETag stays, so revalidation
is a cheap 304. This also closes a real (if narrow) security gap
where a cached response from one auth state could leak into
another. The mashlib HTML wrapper keeps no-store.
0 commit comments