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

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: 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..2ba4c92665ab3ab0f9504781563816ab1f38ebf7 100644
--- a/webkit/child/weburlloader_impl.cc
+++ b/webkit/child/weburlloader_impl.cc
@@ -132,7 +132,17 @@ 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";
sof 2013/10/31 08:19:32 Possible to bring in the use of net::HttpUtil::Ass
tyoshino (SeeGerritForStatus) 2013/10/31 08:53:20 Thanks for suggestion. But it'll be: std::str
sof 2013/10/31 15:26:59 Yes, that wouldn't avoid the explicit formatting o
+ raw_header += '\0';
+ raw_header += "Content-Type: " + mime_type;
+ if (!charset.empty()) {
+ raw_header += ";charset=";
+ raw_header += charset;
+ }
+ raw_header.append("\0\0", 2);
+
+ info->headers = new net::HttpResponseHeaders(raw_header);
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