Don't require an auth key for the static help files. It doesn't play nicely with webkit.

This commit is contained in:
Dave Page 2017-03-26 21:52:31 -04:00
parent ea6d97c49d
commit b2ab35e990

View File

@ -462,10 +462,14 @@ def create_app(app_name=None):
@app.before_request
def before_request():
"""Login the default user if running in desktop mode"""
# Check the auth key is valid, if it's set, and we're not in server
# mode, and it's not a help file request.
if not config.SERVER_MODE and app.PGADMIN_KEY != '':
if (
(not 'key' in request.args or request.args['key'] != app.PGADMIN_KEY) and
request.cookies.get('PGADMIN_KEY') != app.PGADMIN_KEY
request.cookies.get('PGADMIN_KEY') != app.PGADMIN_KEY and
request.endpoint != 'help.static'
):
abort(401)