Chromium Code Reviews| Index: net/base/data_url.cc |
| diff --git a/net/base/data_url.cc b/net/base/data_url.cc |
| index e7b46cd44ceb5bc144d29ffc99fb4489a1a02eaf..18b035df939c03973b6a106cadaf54490503557b 100644 |
| --- a/net/base/data_url.cc |
| +++ b/net/base/data_url.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/strings/string_split.h" |
| #include "base/strings/string_util.h" |
| #include "net/base/escape.h" |
| +#include "net/base/mime_util.h" |
| #include "url/gurl.h" |
| namespace net { |
| @@ -59,9 +60,13 @@ bool DataURL::Parse(const GURL& url, std::string* mime_type, |
| } |
| } |
| - // fallback to defaults if nothing specified in the URL: |
| - if (mime_type->empty()) |
| + if (mime_type->empty()) { |
| + // fallback to defaults if nothing specified in the URL: |
| mime_type->assign("text/plain"); |
| + } else { |
|
asanka
2014/03/27 18:59:52
Nit: else if
tyoshino (SeeGerritForStatus)
2014/03/31 13:02:45
Done.
|
| + if (!ParseMimeTypeWithoutParameter(*mime_type, NULL, NULL)) |
| + return false; |
| + } |
| if (charset->empty()) |
| charset->assign("US-ASCII"); |