Commit d24b85fd authored by spelchat's avatar spelchat Committed by Commit bot

Disable range requests if the origin ignores byte-range.

Use the non-linearized PDF code path if the server doesn't respond to range
requests with a partial response. Previously, Chrome entered a request loop if
the PDF was linearized and the server advertized byte range support but
responded with a 200 code instead of 206.

BUG=587502
R=thestig@chromium.org
TEST=Load https://www.usenix.org/legacy/publications/library/proceedings/sec96/full_papers/goldberg/goldberg.pdf

Review URL: https://codereview.chromium.org/1705353002

Cr-Commit-Position: refs/heads/master@{#376053}
parent 65f0685b
...@@ -383,7 +383,7 @@ void DocumentLoader::DidOpen(int32_t result) { ...@@ -383,7 +383,7 @@ void DocumentLoader::DidOpen(int32_t result) {
multipart_boundary_ = boundary; multipart_boundary_ = boundary;
} else { } else {
// Need to make sure that the server returned a byte-range, since it's // Need to make sure that the server returned a byte-range, since it's
// possible for a server to just ignore our bye-range request and just // possible for a server to just ignore our byte-range request and just
// return the entire document even if it supports byte-range requests. // return the entire document even if it supports byte-range requests.
// i.e. sniff response to // i.e. sniff response to
// http://www.act.org/compass/sample/pdf/geometry.pdf // http://www.act.org/compass/sample/pdf/geometry.pdf
...@@ -393,6 +393,8 @@ void DocumentLoader::DidOpen(int32_t result) { ...@@ -393,6 +393,8 @@ void DocumentLoader::DidOpen(int32_t result) {
current_pos_ = start_pos; current_pos_ = start_pos;
if (end_pos && end_pos > start_pos) if (end_pos && end_pos > start_pos)
current_chunk_size_ = end_pos - start_pos + 1; current_chunk_size_ = end_pos - start_pos + 1;
} else {
partial_document_ = false;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment