Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/needle.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,10 @@ Needle.prototype.send_request = function(count, method, uri, config, post_data,

if (auth_header) {
config.headers['authorization'] = auth_header;
// Destroy the old request to prevent the unauthenticated digest request from causing the needle promise to catch/reject
// This is especially an issue with application/octet-stream request bodies where the server can cause the connection to reset
request.destroy();

return self.send_request(count, method, uri, config, post_data, out, callback);
}
}
Expand Down