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

Unified Diff: content/child/web_url_loader_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 6 years, 9 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: content/child/web_url_loader_impl.cc
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
index 18d8b82cce2dd465e40bf4685394354474523339..9c3578b8a3e6d28d3aa9fd4f00651061f0f86ebd 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -137,7 +137,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");
+ DCHECK(!mime_type.empty());
+ DCHECK(!charset.empty());
+ std::string content_type_header =
+ "Content-Type: " + mime_type + ";charset=" + charset;
abarth-chromium 2014/03/24 16:40:30 Do we know that mime_type and charset are such tha
tyoshino (SeeGerritForStatus) 2014/03/26 17:34:07 Added mime_type grammar check in net::DataURL::Par
+ headers->AddHeader(content_type_header);
+ headers->AddHeader("Access-Control-Allow-Origin: *");
+ headers->AddHeader("Access-Control-Allow-Credentials: true");
abarth-chromium 2014/03/24 16:40:30 I don't think you can combine Access-Control-Allow
tyoshino (SeeGerritForStatus) 2014/03/24 19:36:58 robwu@ suggested this change in #21. With https://
+ 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