Catch unicode decode errors in auth decode
Fixes https://jira.coreos.com/browse/QUAY-1249
This commit is contained in:
parent
72ad0e9789
commit
c3f2901ec0
2 changed files with 8 additions and 1 deletions
|
@ -47,7 +47,7 @@ def _parse_basic_auth_header(auth):
|
|||
|
||||
try:
|
||||
credentials = [part.decode('utf-8') for part in b64decode(normalized[1]).split(':', 1)]
|
||||
except TypeError:
|
||||
except (TypeError, UnicodeDecodeError, ValueError):
|
||||
logger.exception('Exception when parsing basic auth header: %s', auth)
|
||||
return None, 'Could not parse basic auth header'
|
||||
|
||||
|
|
Reference in a new issue