v2: always send www-authn headers on unauthorized

Fixes #1254.
This commit is contained in:
Jimmy Zelinskie 2016-02-22 12:21:22 -05:00
parent a9c64545fa
commit 54a029e2bd
2 changed files with 7 additions and 1 deletions

View file

@ -30,7 +30,10 @@ def handle_registry_v2_exception(error):
response = jsonify({
'errors': [error.as_dict()]
})
response.status_code = error.http_status_code
if response.status_code == 401:
response.headers.extend(get_auth_headers())
logger.debug('sending response: %s', response.get_data())
return response