Skip to content
Myr

Removed Content-Length for chunked

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 0526a24 · Browse files · 2 files+3 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+3 added−8 removed

  • tests:+3 added−6 removed
  • other:+0 added−2 removed

2 files+3 added−8 removed

modified:lib/express/response.js-2 removed
164 unmodified lines
165 + '-'166 + end167 + '/'168 + stat.size);169 self.header('Content-Length', end - start + 1);169 } else {170 var stream = fs.createReadStream(path);172 self.header('Content-Length', stat.size);171 }172 self.contentType(path);173 self.header('Accept-Ranges', 'bytes');174 self.writeHead(status, self.headers);
195 unmodified lines
modified:test/response.test.js+3 added-6 removed
241 unmodified lines
242 { url: '/partials' },243 { body: 'Internal Server Error', status: 500 });244 assert.response(app,245 { url: '/large.json' },246 { status: 200, headers: { 'Content-Length': 2535, 'Content-Type': 'application/json' }});246 { status: 200, headers: { 'Content-Type': 'application/json' }});247 },248 249 'test #sendfile() Accept-Ranges': function(assert){250 var app = express.createServer();
25 unmodified lines
276 assert.response(app,277 { url: '/large.json', headers: { 'Range': 'bytes=0-499' }},278 { headers: {279 'Content-Type': 'application/json',280 'Content-Length': 500,280 'Content-Range': 'bytes 0-499/2535'281 }, status: 206 });282 },283
10 unmodified lines
294295 assert.response(app,296 { url: '/large.json', headers: { 'Range': 'basdytes=asdf' }},297 { headers: {299 'Content-Type': 'application/json',300 'Content-Length': 2535298 'Content-Type': 'application/json'299 }, status: 200 });300 },301 302 'test #sendfile() Range invalid range': function(assert){
9 unmodified lines
312313 assert.response(app,314 { url: '/large.json', headers: { 'Range': 'bytes=500-10' }},315 { headers: {318 'Content-Type': 'application/json',319 'Content-Length': 2535316 'Content-Type': 'application/json'317 }, status: 200 });318 },319 320 'test #download()': function(assert){
85 unmodified lines