1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-10-30 14:53:01 +00:00

Fix #1181 and Fix #1182 handle removed "is_xhr" on werkzeug version 1.0.0

This commit is contained in:
Ozzie Isaacs
2020-02-08 14:39:46 +01:00
parent 2535bbbcf1
commit e04aa80fd6
4 changed files with 15 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ def oauth_required(f):
def inner(*args, **kwargs):
if config.config_login_type == constants.LOGIN_OAUTH:
return f(*args, **kwargs)
if request.is_xhr:
if request.headers.get('X-Requested-With') == 'XMLHttpRequest':
data = {'status': 'error', 'message': 'Not Found'}
response = make_response(json.dumps(data, ensure_ascii=False))
response.headers["Content-Type"] = "application/json; charset=utf-8"