[errors] when responding to a 401, pass through the www-authenticate header
This commit is contained in:
@ -252,6 +252,10 @@ Transport.prototype.request = function (params, cb) {
|
|||||||
errorMetadata.statusCode = status;
|
errorMetadata.statusCode = status;
|
||||||
errorMetadata.response = body;
|
errorMetadata.response = body;
|
||||||
|
|
||||||
|
if (status === 401 && headers && headers['www-authenticate']) {
|
||||||
|
errorMetadata.wwwAuthenticateDirective = headers['www-authenticate'];
|
||||||
|
}
|
||||||
|
|
||||||
if (errors[status]) {
|
if (errors[status]) {
|
||||||
err = new errors[status](parsedBody && parsedBody.error, errorMetadata);
|
err = new errors[status](parsedBody && parsedBody.error, errorMetadata);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user