Ticket #5047: max_age.diff

File max_age.diff, 524 bytes (added by permon, 8 years ago)

update

  • django/utils/cache.py

     
    5757        cc = dict([dictitem(el) for el in cc])
    5858    else:
    5959        cc = {}
     60
     61    if 'max-age' in cc and 'max_age' in kwargs:
     62        kwargs['max_age'] = min(cc['max-age'], kwargs['max_age'])
     63
    6064    for (k,v) in kwargs.items():
    6165        cc[k.replace('_', '-')] = v
    6266    cc = ', '.join([dictvalue(el) for el in cc.items()])
Back to Top