Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed Content-Length for chunked

  • Loading branch information...
commit e338e748eb33d4c540b67e88f3afd889559ceb40 1 parent 0526a24
@tj tj authored
Showing with 3 additions and 8 deletions.
  1. +0 −2  lib/express/response.js
  2. +3 −6 test/response.test.js
View
2  lib/express/response.js
@@ -166,10 +166,8 @@ http.ServerResponse.prototype.sendfile = function(path, fn){
+ end
+ '/'
+ stat.size);
- self.header('Content-Length', end - start + 1);
} else {
var stream = fs.createReadStream(path);
- self.header('Content-Length', stat.size);
}
self.contentType(path);
self.header('Accept-Ranges', 'bytes');
View
9 test/response.test.js
@@ -243,7 +243,7 @@ module.exports = {
{ body: 'Internal Server Error', status: 500 });
assert.response(app,
{ url: '/large.json' },
- { status: 200, headers: { 'Content-Length': 2535, 'Content-Type': 'application/json' }});
+ { status: 200, headers: { 'Content-Type': 'application/json' }});
},
'test #sendfile() Accept-Ranges': function(assert){
@@ -277,7 +277,6 @@ module.exports = {
{ url: '/large.json', headers: { 'Range': 'bytes=0-499' }},
{ headers: {
'Content-Type': 'application/json',
- 'Content-Length': 500,
'Content-Range': 'bytes 0-499/2535'
}, status: 206 });
},
@@ -296,8 +295,7 @@ module.exports = {
assert.response(app,
{ url: '/large.json', headers: { 'Range': 'basdytes=asdf' }},
{ headers: {
- 'Content-Type': 'application/json',
- 'Content-Length': 2535
+ 'Content-Type': 'application/json'
}, status: 200 });
},
@@ -315,8 +313,7 @@ module.exports = {
assert.response(app,
{ url: '/large.json', headers: { 'Range': 'bytes=500-10' }},
{ headers: {
- 'Content-Type': 'application/json',
- 'Content-Length': 2535
+ 'Content-Type': 'application/json'
}, status: 200 });
},
Please sign in to comment.
Something went wrong with that request. Please try again.