Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
Adds "Unauthorized" to the body of a 401 response to maintain compati…
Browse files Browse the repository at this point in the history
…bility with previous release content

Signed-off-by: Zach Hill <zach@anchore.com>
  • Loading branch information
zhill committed Nov 13, 2018
1 parent dce6b97 commit 0002d1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions anchore_engine/apis/authorization.py
Expand Up @@ -343,7 +343,7 @@ def inner_wrapper(*args, **kwargs):
except UnauthorizedAccountError as ex:
return make_response_error(str(ex), in_httpcode=403), 403
except UnauthenticatedError as ex:
return Response(response=None, status=401, headers=[('WWW-Authenticate', 'basic realm="Authentication required"')])
return Response(response='Unauthorized', status=401, headers=[('WWW-Authenticate', 'basic realm="Authentication required"')])
except Exception as ex:
logger.exception('Unexpected exception: {}'.format(ex))
return make_response_error('Internal error', in_httpcode=500), 500
Expand Down Expand Up @@ -417,7 +417,7 @@ def inner_wrapper(*args, **kwargs):
except UnauthorizedError as ex:
return make_response_error(str(ex), in_httpcode=403), 403
except UnauthenticatedError as ex:
return Response(response=None, status=401, headers=[('WWW-Authenticate', 'basic realm="Authentication required"')])
return Response(response='Unauthorized', status=401, headers=[('WWW-Authenticate', 'basic realm="Authentication required"')])
except Exception as ex:
logger.exception('Unexpected exception: {}'.format(ex))
return make_response_error('Internal error', in_httpcode=500), 500
Expand Down

0 comments on commit 0002d1e

Please sign in to comment.