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

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: Rebase 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 27092d5c62d4f430160d8e1c862916e85b8b4446..212e6965b5d491db2e1cc5d834e95720febd0ea8 100644
--- a/webkit/child/weburlloader_impl.cc
+++ b/webkit/child/weburlloader_impl.cc
@@ -132,7 +132,18 @@ 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");
+ DCHECK(!mime_type.empty());
+ DCHECK(!charset.empty());
+ std::string content_type_header =
+ "Content-Type: " + mime_type + ";charset=" + charset;
+ headers->AddHeader(content_type_header);
+ headers->AddHeader("Access-Control-Allow-Origin: *");
sof 2013/11/22 21:42:35 Thinking about this a bit more, this will work as
tyoshino (SeeGerritForStatus) 2014/03/11 06:40:37 Right. When withCredentials is set, the response m
+ 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