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

Unified Diff: chrome/browser/renderer_host/download_resource_handler.cc

Issue 2830017: Disallow apps with the wrong content type header. (Closed)
Patch Set: Rebase for checkin. Created 10 years, 6 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 | « chrome/browser/history/download_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/download_resource_handler.cc
diff --git a/chrome/browser/renderer_host/download_resource_handler.cc b/chrome/browser/renderer_host/download_resource_handler.cc
index fd134e3069ca7f5d44a801fff08ba8c23f8b6929..73d9cec7159147b0e9193427adfc28c412cf9bff 100644
--- a/chrome/browser/renderer_host/download_resource_handler.cc
+++ b/chrome/browser/renderer_host/download_resource_handler.cc
@@ -77,6 +77,13 @@ bool DownloadResourceHandler::OnResponseStarted(int request_id,
info->request_id = global_id_.request_id;
info->content_disposition = content_disposition_;
info->mime_type = response->response_head.mime_type;
+
+ std::string content_type_header;
+ if (!response->response_head.headers ||
+ !response->response_head.headers->GetMimeType(&content_type_header))
+ content_type_header = "";
+ info->original_mime_type = content_type_header;
+
info->save_as = save_as_ && save_info_.file_path.empty();
info->is_dangerous = false;
info->referrer_charset = request_->context()->referrer_charset();
« no previous file with comments | « chrome/browser/history/download_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698