Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Malformed header triggers errors rather than exception handling #130

Open
cugels opened this issue Feb 3, 2019 · 1 comment
Open

Malformed header triggers errors rather than exception handling #130

cugels opened this issue Feb 3, 2019 · 1 comment

Comments

@cugels
Copy link

cugels commented Feb 3, 2019

When sending a POST call to /auth, an errored header with junky fields, triggers a 500 server error. I assume that it should send back a response with the error code or some exception handling message.

To replicate this, type some junk into the key and value, then make a call. If you get the error I’m seeing, on a dev instance, the error handler spits out:

AttributeError: 'NoneType' object has no attribute 'get'
Then the callback ends with:
There’s a long list of errors, which end with:
File "D:_xampp\htdocs_github\spear_api\flask\venv\lib\site-packages\flask_jwt_init_.py", line 115, in _default_auth_request_handler
username = data.get(current_app.config.get('JWT_AUTH_USERNAME_KEY'), None)

It looks like this is related to an old issue, so perhaps this has reemerged:
#80

@vimalloc
Copy link

vimalloc commented Feb 3, 2019

This project has been abandoned for quiet a while now. Perhaps check out flask-jwt-extended as an alternative. https://flask-jwt-extended.readthedocs.io/en/latest/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants