Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 1585403004: Pass the content size in the content-length header for file:// streams. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: int64 Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index d671e2b715abefdc166efd1417e480ffc84f137b..b864edc55f8ca8fb6169c83e4e4b0916bafc84c8 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -825,6 +825,11 @@ scoped_ptr<ResourceHandler> ResourceDispatcherHostImpl::MaybeInterceptAsStream(
if (response->head.headers.get()) {
stream_info->response_headers =
new net::HttpResponseHeaders(response->head.headers->raw_headers());
+ } else if (stream_info->original_url.SchemeIsFile()) {
+ stream_info->response_headers = new net::HttpResponseHeaders(std::string());
+ stream_info->response_headers->AddHeader(
+ "content-length: " +
+ base::Int64ToString(response->head.content_length));
mmenke 2016/01/15 22:20:59 The PDF viewer uses the content-length header to m
mmenke 2016/01/15 22:29:14 If we go the bogus header route, wonder if we shou
Lei Zhang 2016/01/15 23:13:29 Sorry, I don't know anything about file URLS and "
Lei Zhang 2016/01/15 23:13:29 I can't speak for other places. The StreamInfo is
mmenke 2016/05/11 19:31:16 My preference, from a correctness standpoint, woul
}
delegate_->OnStreamCreated(request, std::move(stream_info));
return std::move(handler);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698