Allow non specific cookies

This commit is contained in:
Cqoicebordel 2015-01-19 20:16:06 +01:00
parent fecac90e88
commit b01b95194e
1 changed files with 5 additions and 2 deletions

View File

@ -471,6 +471,8 @@ def preferences():
blocked_engines = [] blocked_engines = []
resp = make_response(redirect(url_for('index')))
if request.method == 'GET': if request.method == 'GET':
blocked_engines = request.cookies.get('blocked_engines', '').split(',') blocked_engines = request.cookies.get('blocked_engines', '').split(',')
else: # on save else: # on save
@ -502,8 +504,8 @@ def preferences():
blocked_engines.append(engine_name) blocked_engines.append(engine_name)
elif pd_name == 'theme': elif pd_name == 'theme':
theme = pd if pd in themes else default_theme theme = pd if pd in themes else default_theme
else:
resp = make_response(redirect(url_for('index'))) resp.set_cookie(pd_name, pd, max_age=cookie_max_age)
user_blocked_engines = request.cookies.get('blocked_engines', '').split(',') # noqa user_blocked_engines = request.cookies.get('blocked_engines', '').split(',') # noqa
@ -555,6 +557,7 @@ def preferences():
autocomplete_backends=autocomplete_backends, autocomplete_backends=autocomplete_backends,
shortcuts={y: x for x, y in engine_shortcuts.items()}, shortcuts={y: x for x, y in engine_shortcuts.items()},
themes=themes, themes=themes,
cookies=request.cookies,
theme=get_current_theme_name()) theme=get_current_theme_name())