Ticket #18191: ignore_accept_language.diff

File ignore_accept_language.diff, 851 bytes (added by choongmin@…, 3 years ago)
  • django/utils/cache.py

     
    234234    if cache is None:
    235235        cache = get_cache(settings.CACHE_MIDDLEWARE_ALIAS)
    236236    if response.has_header('Vary'):
    237         headerlist = ['HTTP_'+header.upper().replace('-', '_')
    238                       for header in cc_delim_re.split(response['Vary'])]
     237        headerlist = []
     238        for header in cc_delim_re.split(response['Vary']):
     239            header = header.upper().replace('-', '_')
     240            if header != 'ACCEPT_LANGUAGE':
     241                headerlist.append('HTTP_' + header)
    239242        cache.set(cache_key, headerlist, cache_timeout)
    240243        return _generate_cache_key(request, request.method, headerlist, key_prefix)
    241244    else:
Back to Top