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

Multi auth error - need more than 1 value to unpack #51

Closed
jm66 opened this issue Jan 6, 2017 · 2 comments
Closed

Multi auth error - need more than 1 value to unpack #51

jm66 opened this issue Jan 6, 2017 · 2 comments
Assignees
Labels

Comments

@jm66
Copy link

jm66 commented Jan 6, 2017

Using MultiAuth (basic+token) and I'm getting an error when not providing a scheme in the Authorization header.

For instance a http :5000/api/ "Authorization: $TK" will throw a 500 error:

scheme, creds = request.headers['Authorization'].split(None, 1)
ValueError: need more than 1 value to unpack

Using try-catch to bypass the exception might be one quick solution. Thoughts?

@miguelgrinberg
Copy link
Owner

The scheme field is required, you cannot omit it.

I can address this, but the correct way to do it is by returning a 400 error, since the header missing the scheme is malformed.

@miguelgrinberg miguelgrinberg self-assigned this Jan 6, 2017
@jm66
Copy link
Author

jm66 commented Jan 6, 2017

Understood. Thanks.

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

No branches or pull requests

2 participants