From f69f387e1d9676f730206d37c8e2761efb18bf7f Mon Sep 17 00:00:00 2001 From: Peter 'Pita' Martischka Date: Wed, 20 Jul 2011 17:29:26 +0100 Subject: [PATCH] Send response once we got all POST data, not immediately --- lib/transports/http.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/transports/http.js b/lib/transports/http.js index b2cf2705c1..cbf4e26a59 100644 --- a/lib/transports/http.js +++ b/lib/transports/http.js @@ -54,6 +54,9 @@ HTTPTransport.prototype.handleRequest = function (req) { }); req.on('end', function () { + res.writeHead(200, headers); + res.end('1'); + self.onData(self.postEncoded ? qs.parse(buffer).d : buffer); }); @@ -65,9 +68,6 @@ HTTPTransport.prototype.handleRequest = function (req) { headers['Access-Control-Allow-Credentials'] = 'true'; } } - - res.writeHead(200, headers); - res.end('1'); } else { this.response = req.res;