Skip to content

Commit cb437ba

Browse files
committed
Fix ambiguity between header fields beginning with same characters
1 parent cc5a93c commit cb437ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

flask_jwt_extended/view_decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def _decode_jwt_from_headers():
183183
# <HeaderName>: <field> <value>, <field> <value>, etc...
184184
if header_type:
185185
field_values = split(r',\s*', auth_header)
186-
jwt_header = [s for s in field_values if s.startswith(header_type)]
186+
jwt_header = [s for s in field_values if s.split()[0]==header_type]
187187
if len(jwt_header) < 1:
188188
msg = "Bad {} header. Expected value '{} <JWT>'".format(
189189
header_name,

0 commit comments

Comments
 (0)