You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in src/allianceutils/middleware/http_auth.py makes the assumption that the Authorization header will contain a space character. If it does not, a ValueError is raised, along the lines of ValueError: not enough values to unpack (expected 2, got 1).
The problem with this is that we wind up with a 500 server error response as the uncaught exception propagates. It might be better to detect this scenario and explicitly return a 401 (eg. call return self.__unauthorized()). Or maybe not, that could actually make it harder to debug.
I ran into this because I have a client application trying to make an API call, and that application uses the Authorization header itself, which causes a conflict when HTTP Basic Auth is also enabled.
The text was updated successfully, but these errors were encountered:
I think returning a 401 is correct, but we could also log a warning that the authorization header is invalid if it doesn't contain a space to assist with debugging
This line:
in
src/allianceutils/middleware/http_auth.py
makes the assumption that the Authorization header will contain a space character. If it does not, a ValueError is raised, along the lines ofValueError: not enough values to unpack (expected 2, got 1)
.The problem with this is that we wind up with a 500 server error response as the uncaught exception propagates. It might be better to detect this scenario and explicitly return a 401 (eg. call
return self.__unauthorized()
). Or maybe not, that could actually make it harder to debug.I ran into this because I have a client application trying to make an API call, and that application uses the
Authorization
header itself, which causes a conflict when HTTP Basic Auth is also enabled.The text was updated successfully, but these errors were encountered: