mirror of
https://framagit.org/medoc92/recollwebui.git
synced 2026-10-19 11:04:39 +00:00
Set Vary: Cookie and No-Vary-Search: key-order headers. Closes issue #20
This commit is contained in:
parent
fb37658e74
commit
ed0737b1d3
1 changed files with 11 additions and 0 deletions
11
webui.py
11
webui.py
|
|
@ -429,6 +429,7 @@ def server_static(path):
|
|||
@bottle.view('main')
|
||||
def main():
|
||||
config = get_config()
|
||||
bottle.response.headers['Vary'] = 'Cookie'
|
||||
return { 'dirs': get_dirs(config['dirs'], config['dirdepth']),
|
||||
'query': get_query(config), 'sorts': SORTS, 'config': config}
|
||||
#}}}
|
||||
|
|
@ -444,6 +445,8 @@ def results():
|
|||
config['maxresults'] = nres
|
||||
if config['perpage'] == 0:
|
||||
config['perpage'] = nres
|
||||
bottle.response.headers['Vary'] = 'Cookie'
|
||||
bottle.response.headers['No-Vary-Search'] = 'key-order'
|
||||
return { 'res': res, 'time': timer, 'query': query, 'dirs':
|
||||
get_dirs(config['dirs'], config['dirdepth']),
|
||||
'qs': qs, 'sorts': SORTS, 'config': config,
|
||||
|
|
@ -482,6 +485,8 @@ def preview(resnum):
|
|||
txt
|
||||
bottle.response.content_type = 'text/html; charset=utf-8'
|
||||
return txt
|
||||
bottle.response.headers['Vary'] = 'Cookie'
|
||||
bottle.response.headers['No-Vary-Search'] = 'key-order'
|
||||
return tdoc.text
|
||||
#}}}
|
||||
#{{{ download
|
||||
|
|
@ -509,6 +514,8 @@ def edit(resnum):
|
|||
os.unlink(path)
|
||||
except:
|
||||
pass
|
||||
bottle.response.headers['Vary'] = 'Cookie'
|
||||
bottle.response.headers['No-Vary-Search'] = 'key-order'
|
||||
return f
|
||||
#}}}
|
||||
#{{{ json
|
||||
|
|
@ -517,6 +524,8 @@ def get_json():
|
|||
config = get_config()
|
||||
query = get_query(config)
|
||||
qs = query_to_recoll_string(query)
|
||||
bottle.response.headers['Vary'] = 'Cookie'
|
||||
bottle.response.headers['No-Vary-Search'] = 'key-order'
|
||||
bottle.response.headers['Content-Type'] = 'application/json'
|
||||
bottle.response.headers['Content-Disposition'] = \
|
||||
'attachment; filename=recoll-%s.json' % normalise_filename(qs)
|
||||
|
|
@ -538,6 +547,8 @@ def get_csv():
|
|||
query['page'] = 0
|
||||
query['snippets'] = 0
|
||||
qs = query_to_recoll_string(query)
|
||||
bottle.response.headers['Vary'] = 'Cookie'
|
||||
bottle.response.headers['No-Vary-Search'] = 'key-order'
|
||||
bottle.response.headers['Content-Type'] = 'text/csv'
|
||||
bottle.response.headers['Content-Disposition'] = \
|
||||
'attachment; filename=recoll-%s.csv' % normalise_filename(qs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue