api: fix error when authorization is empty
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
5a25e6d697
commit
3d9874be69
|
@ -15,6 +15,8 @@ LOGGER = get_logger()
|
||||||
def token_from_header(raw_header: bytes) -> Optional[Token]:
|
def token_from_header(raw_header: bytes) -> Optional[Token]:
|
||||||
"""raw_header in the Format of `Basic dGVzdDp0ZXN0`"""
|
"""raw_header in the Format of `Basic dGVzdDp0ZXN0`"""
|
||||||
auth_credentials = raw_header.decode()
|
auth_credentials = raw_header.decode()
|
||||||
|
if auth_credentials == "":
|
||||||
|
return None
|
||||||
# Legacy, accept basic auth thats fully encoded (2021.3 outposts)
|
# Legacy, accept basic auth thats fully encoded (2021.3 outposts)
|
||||||
if " " not in auth_credentials:
|
if " " not in auth_credentials:
|
||||||
try:
|
try:
|
||||||
|
|
Reference in New Issue