Skip to content

Commit

Permalink
add ability to sign request without buffering content (postFromFile and
Browse files Browse the repository at this point in the history
getToFile)
  • Loading branch information
xmilliard committed Sep 21, 2011
1 parent efd44ca commit cadaf19
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/oauth.js
Expand Up @@ -375,13 +375,13 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke




var targetFile; var targetFile;
if(method == "GET" && useFile) {
targetFile = fs.createWriteStream(post_body);
}
else {
response.setEncoding('utf8');
}
request.on('response', function (response) { request.on('response', function (response) {
if(method == "GET" && response.statusCode == 200 && useFile) {
targetFile = fs.createWriteStream(post_body);
}
else {
response.setEncoding('utf8');
}
response.on('data', function (chunk) { response.on('data', function (chunk) {
if(targetFile) { if(targetFile) {
targetFile.write(chunk); targetFile.write(chunk);
Expand Down

0 comments on commit cadaf19

Please sign in to comment.