api basic auth - ignore non-utf8 chars, fixes #282
This commit is contained in:
parent
fbb781dd81
commit
253391053c
@ -121,7 +121,10 @@ def basic_authenticate(auth):
|
||||
authmeth, auth = auth.split(' ', 1)
|
||||
if authmeth.lower() != 'basic':
|
||||
return
|
||||
auth = base64.b64decode(auth.strip()).decode('utf-8')
|
||||
# we ignore bytes that do not decode. username (hostname) and password
|
||||
# (update secret) both have to be ascii, everything else is a configuration
|
||||
# error on user side.
|
||||
auth = base64.b64decode(auth.strip()).decode('utf-8', errors='ignore')
|
||||
username, password = auth.split(':', 1)
|
||||
return username, password
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user