From 35dcbe5049e3ca4cffefddee83dbbfdcabf07b40 Mon Sep 17 00:00:00 2001 From: Stephen Wolff Date: Wed, 3 Jul 2019 06:32:55 +0200 Subject: [PATCH] Remove redundant config check in locations loop --- flask_jwt_extended/view_decorators.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/flask_jwt_extended/view_decorators.py b/flask_jwt_extended/view_decorators.py index 442ccd5f..f95a47e2 100644 --- a/flask_jwt_extended/view_decorators.py +++ b/flask_jwt_extended/view_decorators.py @@ -252,14 +252,14 @@ def _decode_jwt_from_request(request_type): # add the functions in the order specified in JWT_TOKEN_LOCATION for location in locations: - if location == 'cookies' and config.jwt_in_cookies: + if location == 'cookies': get_encoded_token_functions.append( lambda: _decode_jwt_from_cookies(request_type)) - if location == 'query_string' and config.jwt_in_query_string: + if location == 'query_string': get_encoded_token_functions.append(_decode_jwt_from_query_string) - if location == 'headers' and config.jwt_in_headers: + if location == 'headers': get_encoded_token_functions.append(_decode_jwt_from_headers) - if location == 'json' and config.jwt_in_json: + if location == 'json': get_encoded_token_functions.append( lambda: _decode_jwt_from_json(request_type))