Fix error handling
buildbot/multibuild_parent Build done. Details
buildbot/travis_bionic Build done. Details

This commit is contained in:
Peter Šurda 2023-12-04 16:18:55 +08:00
parent 7f2ac0ff6b
commit 2467612e42
Signed by: PeterSurda
GPG Key ID: 3E47497CF67ABB95
1 changed files with 1 additions and 3 deletions

View File

@ -51,10 +51,8 @@ def process_combined(combined):
def get_token(input_token):
token = input_token.lstrip("Basic ")
token = b64decode(token).decode('utf8', 'ignore')
try:
with cherrypy.HTTPError.handle(ValueError, 401):
_, token = token.split(":", 2)
except ValueError:
raise cherrypy.HTTPError(401, 'Unauthorized')
return token
class Root: