Skip to content
Snippets Groups Projects
Commit 9b557b87 authored by Felipe Cecagno's avatar Felipe Cecagno Committed by Pedro Beschorner Marin
Browse files

consider 401 as a success status for a callback

parent 89956629
No related branches found
No related tags found
No related merge requests found
......@@ -109,7 +109,8 @@ module.exports = class CallbackEmitter extends EventEmitter {
const responseFailed = (response) => {
var statusCode = (response != null ? response.statusCode : undefined)
return !((statusCode >= 200) && (statusCode < 300))
// consider 401 as success, because the callback worked but was denied by the recipient
return !((statusCode >= 200 && statusCode < 300) || statusCode == 401)
};
request(requestOptions, function(error, response, body) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment