Skip to content

Commit

Permalink
server: do not use chunked encoding
Browse files Browse the repository at this point in the history
* probably fixes spdy-http2#41
  • Loading branch information
indutny committed Mar 20, 2012
1 parent a17b4d5 commit 3238666
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/twitlog/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var fs = require('fs');

var image = fs.readFileSync(__dirname + '/../public/images/nodejs.png');

exports.index = function(req, res){
exports.index = function(req, res) {
if (res.isSpdy) {
var ua = req.headers['user-agent'];

Expand Down
3 changes: 3 additions & 0 deletions lib/spdy/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ function instantiate(HTTPSServer) {
res.streamID = req.streamID = req.socket.id;
res.isSpdy = req.isSpdy = true;

// Chunked encoding is not supported in SPDY
res.useChunkedEncodingByDefault = false;

res.on('finish', function() {
req.connection.end();
});
Expand Down

0 comments on commit 3238666

Please sign in to comment.