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

Unified Diff: net/base/mime_util.cc

Issue 97913002: Recognize json media types as (non-image) mime types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 | net/base/mime_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_util.cc
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index 8eba45ac101ff71cf6d273ab2de00d1e386498a6..3fbf08367c956013b3dcc3b79bd583aebbdfcf41 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -518,7 +518,9 @@ bool MimeUtil::IsSupportedMediaMimeType(const std::string& mime_type) const {
bool MimeUtil::IsSupportedNonImageMimeType(const std::string& mime_type) const {
return non_image_map_.find(mime_type) != non_image_map_.end() ||
(mime_type.compare(0, 5, "text/") == 0 &&
- !IsUnsupportedTextMimeType(mime_type));
+ !IsUnsupportedTextMimeType(mime_type)) ||
+ (mime_type.compare(0, 12, "application/") == 0 &&
+ MatchesMimeType("application/*+json", mime_type));
abarth-chromium 2013/12/01 23:02:32 Is this how we check for +xml as well?
sof 2013/12/02 06:28:58 Good question; there is no generic check for "xml
}
bool MimeUtil::IsUnsupportedTextMimeType(const std::string& mime_type) const {
« no previous file with comments | « no previous file | net/base/mime_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698