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

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: Addressed abarth's comment on Blink side Created 7 years, 2 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: webkit/child/weburlloader_impl.cc
diff --git a/webkit/child/weburlloader_impl.cc b/webkit/child/weburlloader_impl.cc
index 09273f8881b2fe825a330bfc50fbf72138860e49..e3d89627d3c13462ab54da9dd14f120f3c4072a4 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;
+
+ std::string raw_header = "HTTP/1.1 200 OK";
+ raw_header += '\0';
+ raw_header += "Content-Type: " + mime_type;
+ if (!charset.empty()) {
+ raw_header += ";charset=";
+ raw_header += charset;
+ }
+ raw_header += '\0';
+ raw_header += "Access-Control-Allow-Origin: *";
+ raw_header.append("\0\0", 2);
+
+ info->headers = new net::HttpResponseHeaders(raw_header);
abarth-chromium 2013/11/01 16:48:55 It seems like there should be a higher-level API f
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