Skip to content

Commit 69b93ea

Browse files
committed
Prevent automatic use of chunked-encoding
Fixes #8
1 parent 58e7a07 commit 69b93ea

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/response.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ function Response(req) {
3838
}
3939

4040
this._storeHeader = function (statusLine, headers) {
41+
if (!this.getHeader('transfer-encoding')) {
42+
// This is required to prevent nodejs using chunked-encoding
43+
// when no content-length header is present
44+
this.removeHeader('transfer-encoding');
45+
}
46+
4147
return http.ServerResponse.prototype._storeHeader.call(
4248
this, statusLine.replace('HTTP/1.1', 'Status:'), headers);
4349
};

0 commit comments

Comments
 (0)