Skip to content

Commit

Permalink
How do you include headers, but exclude body in the response? node-js…
Browse files Browse the repository at this point in the history
  • Loading branch information
Matjaz Jurecic committed Jun 2, 2016
1 parent d897eb4 commit 7830315
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,14 @@ exports.request = function (options, callback) {
delete options.curl_path;
}

//Follow location by default
if ('max-redirs' in options) {
options.location = !!options['max-redirs'];
} else {
if (!('location' in options)) {
options.location = true;
} else if (!options.location) {
delete options.location;
}

//Follow location by default
if (!('max-redirs' in options)) {
options['max-redirs'] = 3;
}

Expand Down

0 comments on commit 7830315

Please sign in to comment.