From 4955c04dacb42773d718909b8fe55b7abfb85d1e Mon Sep 17 00:00:00 2001 From: Jan Keromnes Date: Sat, 1 Oct 2016 15:01:39 +0000 Subject: [PATCH] Support post data on PATCH requests in OAuth2 --- lib/oauth2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/oauth2.js b/lib/oauth2.js index 94ed662c..c559f31c 100644 --- a/lib/oauth2.js +++ b/lib/oauth2.js @@ -148,7 +148,7 @@ exports.OAuth2.prototype._executeRequest= function( http_library, options, post_ callback(e); }); - if( (options.method == 'POST' || options.method == 'PUT') && post_body ) { + if( ['POST','PUT','PATCH'].indexOf(options.method) > -1 && post_body ) { request.write(post_body); } request.end();