Skip to content

Commit

Permalink
Merge pull request #865 from mrsharpoblunto/master
Browse files Browse the repository at this point in the history
Fixed conflict with express (and possibly other libraries) when using npm 3.x
  • Loading branch information
kornelski committed Jan 20, 2016
2 parents 5b903fa + 8f5abf1 commit 324c97a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/node/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ Agent.prototype.attachCookies = function(req){
};

// generate HTTP verb methods
methods.indexOf('del') == -1 && methods.push('del');
if (methods.indexOf('del') == -1) {
// create a copy so we don't cause conflicts with
// other packages using the methods package and
// npm 3.x
methods = methods.slice(0);
methods.push('del');
}
methods.forEach(function(method){
var name = method;
method = 'del' == method ? 'delete' : method;
Expand Down
8 changes: 7 additions & 1 deletion lib/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,13 @@ function request(method, url) {
}

// generate HTTP verb methods
methods.indexOf('del') == -1 && methods.push('del');
if (methods.indexOf('del') == -1) {
// create a copy so we don't cause conflicts with
// other packages using the methods package and
// npm 3.x
methods = methods.slice(0);
methods.push('del');
}
methods.forEach(function(method){
var name = method;
method = 'del' == method ? 'delete' : method;
Expand Down

0 comments on commit 324c97a

Please sign in to comment.