Skip to content

Commit d723d36

Browse files
committed
Always set the HTTP response in case an error should be returned to the client
1 parent 48ad0d3 commit d723d36

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/transports/http.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ HTTPTransport.prototype.__proto__ = Transport.prototype;
4242
*/
4343

4444
HTTPTransport.prototype.handleRequest = function (req) {
45+
46+
// Always set the response in case an error is returned to the client
47+
this.response = req.res;
48+
4549
if (req.method == 'POST') {
4650
var buffer = ''
4751
, res = req.res
@@ -77,8 +81,6 @@ HTTPTransport.prototype.handleRequest = function (req) {
7781
headers['Access-Control-Allow-Credentials'] = 'true';
7882
}
7983
} else {
80-
this.response = req.res;
81-
8284
Transport.prototype.handleRequest.call(this, req);
8385
}
8486
};

0 commit comments

Comments
 (0)