transports: fix for Connection: close [stbuehler] (fixes #406)

This commit is contained in:
Guillermo Rauch
2012-11-01 17:14:06 -07:00
parent 4de65523d9
commit dbabf20faa

View File

@@ -10,7 +10,7 @@
*/
var HTTPPolling = require('./http-polling');
var jsonpolling_re = /^\d+$/
var jsonpolling_re = /^\d+$/;
/**
* Export the constructor.
@@ -83,12 +83,12 @@ JSONPPolling.prototype.doWrite = function (data) {
HTTPPolling.prototype.doWrite.call(this);
var data = data === undefined
? '' : this.head + JSON.stringify(data) + this.foot;
? ''
: this.head + JSON.stringify(data) + this.foot;
this.response.writeHead(200, {
'Content-Type': 'text/javascript; charset=UTF-8'
, 'Content-Length': Buffer.byteLength(data)
, 'Connection': 'Keep-Alive'
, 'X-XSS-Protection': '0'
});