wrapped around...
var raw = fs.createReadStream(filePath);
var encoding = 'deflate' ;
raw.pipe(zlib.createDeflate()).pipe(res);
res.writeHead(200, {
'content-encoding' : encoding,
'Content-Type': contentType + '; charset=utf-8'
});
res.end()
If I do this, Chrome loads, IE fails:
var raw = fs.createReadStream(filePath);
var encoding = 'deflate' ;
raw.pipe(zlib.createDeflate()).pipe(res);
res.writeHead(200, {
'content-encoding' : encoding,
'Content-Type': contentType + '; charset=utf-8'
});
If I do this, there is no "end" event on the "res"
var raw = fs.createReadStream(filePath);
var encoding = 'deflate' ;
raw.pipe(zlib.createDeflate()).pipe(res);
res.writeHead(200, {
'content-encoding' : encoding,
'Content-Type': contentType + '; charset=utf-8'
});
res.on('end', res.end )
If I do this, the server crashes with:
- http.js:919
this._implicitHeader();
^
TypeError: Object #<ReadStream> has no method '_implicitHeader'
at ReadStream.OutgoingMessage.end (http.js:919:10)
at ReadStream.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickCallback (node.js:442:13)
var raw = fs.createReadStream(filePath);
var encoding = 'deflate' ;
raw.pipe(zlib.createDeflate()).pipe(res);
res.writeHead(200, {
'content-encoding' : encoding,
'Content-Type': contentType + '; charset=utf-8'
});
raw.on('end', res.end )
I am in the know about the Node.js documentation, where it says:
- "The method, response.end()
, MUST be called on each response."
http://nodejs.org/api/http.html#http_response_end_data_encoding_callback
...
What can I do?