senchalabs/connect — Issue #436: Static: Content Range's Content Length
Author: jostylr
Created: 2011-12-15 02:53:02+00:00
State: open

In static.js, a content-range that is bigger than the length of the data leads to an incorrect (bigger) content-length being reported. This created an issue with the Facebook Open-Graph scraper, for example. I fixed it with an if statement around line 190ish:

if ((requestedLength < stat.size) || (opts.start !== 0)) {
chunkSize = requestedLength;
res.statusCode = 206;
res.setHeader('Content-Range', 'bytes '
+ opts.start
+ '-'
+ opts.end
+ '/'
+ stat.size);
}

New to git.