From 7e67f67ca6ac607046592f763202ad2a55736451 Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Sun, 17 Mar 2024 20:46:33 +1300 Subject: [PATCH] update Vary header to account for language --- app/post/routes.py | 4 ++-- app/utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/post/routes.py b/app/post/routes.py index a40a10cd..993400cb 100644 --- a/app/post/routes.py +++ b/app/post/routes.py @@ -224,7 +224,7 @@ def show_post(post_id: int): joined_communities=joined_communities(current_user.get_id()), inoculation=inoculation[randint(0, len(inoculation) - 1)] ) - response.headers.set('Vary', 'Accept, Cookie') + response.headers.set('Vary', 'Accept, Cookie, Accept-Language') return response @@ -416,7 +416,7 @@ def continue_discussion(post_id, comment_id): moderating_communities=moderating_communities(current_user.get_id()), joined_communities=joined_communities(current_user.get_id()), community=post.community, inoculation=inoculation[randint(0, len(inoculation) - 1)]) - response.headers.set('Vary', 'Accept, Cookie') + response.headers.set('Vary', 'Accept, Cookie, Accept-Language') return response diff --git a/app/utils.py b/app/utils.py index 47feb13c..1832d1b6 100644 --- a/app/utils.py +++ b/app/utils.py @@ -59,7 +59,7 @@ def return_304(etag, content_type=None): resp = make_response('', 304) resp.headers.add_header('ETag', request.headers['If-None-Match']) resp.headers.add_header('Cache-Control', 'no-cache, max-age=600, must-revalidate') - resp.headers.add_header('Vary', 'Accept, Cookie') + resp.headers.add_header('Vary', 'Accept, Cookie, Accept-Language') if content_type: resp.headers.set('Content-Type', content_type) return resp