Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert #5603 regarding Chrome range request bug #5979

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions src/core/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,6 @@ var WorkerMessageHandler = PDFJS.WorkerMessageHandler = {

var length = fullRequestXhr.getResponseHeader('Content-Length');
length = parseInt(length, 10);
//#if (GENERIC || CHROME)
if (fullRequestXhr.status === 206) {
// Since Chrome 39, there exists a bug where cached responses are
// served with status code 206 for non-range requests.
// Content-Length does not specify the total size of the resource
// when the status code is 206 (see RFC 2616, section 14.16).
// In this case, extract the file size from the Content-Range
// header, which is defined to be "bytes start-end/length" for
// byte range requests.
// See https://github.com/mozilla/pdf.js/issues/5512 and
// https://code.google.com/p/chromium/issues/detail?id=442318
length = fullRequestXhr.getResponseHeader('Content-Range');
length = length && /bytes \d+-\d+\/(\d+)/.exec(length);
length = length && parseInt(length[1], 10);
}
//#endif
if (!isInt(length)) {
return;
}
Expand Down