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

Unified Diff: webkit/child/weburlloader_impl.cc

Issue 54233002: Make net::DataURL's MIME string check stricter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sof and abarth's comment Created 7 years, 1 month 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: webkit/child/weburlloader_impl.cc
diff --git a/webkit/child/weburlloader_impl.cc b/webkit/child/weburlloader_impl.cc
index 09273f8881b2fe825a330bfc50fbf72138860e49..cbabccb06c62a5786ddc6737d7ec766c058932ae 100644
--- a/webkit/child/weburlloader_impl.cc
+++ b/webkit/child/weburlloader_impl.cc
@@ -132,7 +132,19 @@ bool GetInfoFromDataURL(const GURL& url,
info->load_timing.request_start_time = now;
info->request_time = now;
info->response_time = now;
- info->headers = NULL;
+
+ scoped_refptr<net::HttpResponseHeaders> headers(
+ new net::HttpResponseHeaders(std::string()));
+ headers->ReplaceStatusLine("HTTP/1.1 200 OK");
+ std::string content_type_header = "Content-Type: " + mime_type;
sof 2013/11/08 13:34:34 Slight inconsistency in assumptions here; you don'
tyoshino (SeeGerritForStatus) 2013/11/12 05:47:26 Thanks. I see. It's well documented in the comment
+ if (!charset.empty()) {
+ content_type_header += ";charset=";
+ content_type_header += charset;
+ }
+ headers->AddHeader(content_type_header);
+ headers->AddHeader("Access-Control-Allow-Origin: *");
+ info->headers = headers;
+
info->mime_type.swap(mime_type);
info->charset.swap(charset);
info->security_info.clear();
« 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