fix(stats): include locale header in vary (#34789)

This commit is contained in:
Adam 2026-07-01 15:25:49 -05:00 committed by GitHub
commit fc29f99190
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 5 deletions

View file

@ -39,7 +39,7 @@ export async function statsProxy(evt: APIEvent) {
headers.delete("content-encoding")
headers.delete("content-length")
headers.delete("etag")
appendVary(headers, "Accept-Language", "Cookie")
appendVary(headers, "Accept-Language", "Cookie", LOCALE_HEADER)
return new Response(rewriteStatsHtml(await response.text()), {
status: response.status,
@ -78,7 +78,7 @@ function redirectToLocalizedData(request: Request, url: URL, locale: ReturnType<
Location: next.toString(),
})
headers.append("set-cookie", cookie(locale))
appendVary(headers, "Accept-Language", "Cookie")
appendVary(headers, "Accept-Language", "Cookie", LOCALE_HEADER)
return new Response(null, {
status: 308,