mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-10 00:42:06 +00:00
Fix formatting of s-maxage
This commit is contained in:
@ -8,7 +8,7 @@ def ssl_required(fn):
|
||||
def nocache(fn):
|
||||
def _nocache(request, *_args, **_kwargs):
|
||||
resp = fn(request, *_args, **_kwargs)
|
||||
resp['Cache-Control'] = 's-maxage: 0'
|
||||
resp['Cache-Control'] = 's-maxage=0'
|
||||
return resp
|
||||
return _nocache
|
||||
|
||||
@ -18,7 +18,7 @@ def cache(days=0, hours=0, minutes=0, seconds=0):
|
||||
def __cache(request, *_args, **_kwargs):
|
||||
resp = fn(request, *_args, **_kwargs)
|
||||
td = datetime.timedelta(hours=hours, minutes=minutes, seconds=seconds)
|
||||
resp['Cache-Control'] = 's-maxage: %s' % (td.days*3600*24 + td.seconds)
|
||||
resp['Cache-Control'] = 's-maxage=%s' % (td.days*3600*24 + td.seconds)
|
||||
return resp
|
||||
return __cache
|
||||
return _cache
|
||||
|
Reference in New Issue
Block a user