Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only end request after we've checked wether we need to send the body.

  • Loading branch information...
commit 39f505437dbfdb3abecdf36b72271055f741563c 1 parent b6ed213
@novemberborn novemberborn authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 engines/node/lib/http-client.js
View
6 engines/node/lib/http-client.js
@@ -51,7 +51,6 @@ exports.request = function(originalRequest){
var req = client.request(request.method || "GET", requestPath, request.headers ||
{host: request.host || request.hostname + (request.port ? ":" + request.port : "")});
var timedOut;
- req.end();
req.on("response", function (response){
if(timedOut){
return;
@@ -103,7 +102,8 @@ exports.request = function(originalRequest){
req.end();
return deferred.promise;
});
+ }else{
+ req.end();
+ return deferred.promise;
}
- req.end();
- return deferred.promise;
};
Please sign in to comment.
Something went wrong with that request. Please try again.