update Vary header to account for language

This commit is contained in:
rimu 2024-03-17 20:46:33 +13:00
parent fed38857f8
commit 7e67f67ca6
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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