Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashin with ValueError when passing a HTTP_Authorization header that doesn't have space in it. #12

Open
driesdesmet opened this issue Mar 6, 2018 · 0 comments

Comments

@driesdesmet
Copy link

Because of this line in the middleware:

method, claim = request.META['HTTP_AUTHORIZATION'].split(' ', 1)

any request created with such a header without a space is getting:

ValueError: need more than 1 value to unpack

I've manually replaced this with:

try:
    method, claim = request.META['HTTP_AUTHORIZATION'].split(' ', 1)
except ValueError:
    logger.debug('HTTP_AUTHORIZATION does not have the right format for asymmetric JWT authentication.')
    return

Want a pull request?

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

No branches or pull requests

1 participant