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

Unified Diff: net/base/mime_sniffer.cc

Issue 2883833002: net: Do not sniff XHTML content (Closed)
Patch Set: Remove XHTML content sniff entirely Created 3 years, 7 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 | net/base/mime_sniffer_unittest.cc » ('j') | net/base/mime_sniffer_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_sniffer.cc
diff --git a/net/base/mime_sniffer.cc b/net/base/mime_sniffer.cc
index 608f870cfed21ec047be1ea799c5c1aa898ba299..0da501ef4d650efcc436d00fe8f4e5a466420506 100644
--- a/net/base/mime_sniffer.cc
+++ b/net/base/mime_sniffer.cc
@@ -80,15 +80,6 @@
// compatibility if we don't sniff from application/octet stream at all.
// => Chrome: Download as application/octet-stream
//
-// XHTML payload, Content-Type: "text/xml":
-// * IE 7: Render as XML
-// * Firefox 2: Render as HTML
-// * Safari 3: Render as HTML
-// * Opera 9: Render as HTML
-// The layout tests rely on us rendering this as HTML.
-// But we're conservative in XHTML detection, as this runs afoul of the
-// "don't detect dangerous mime types" rule.
-//
// Note that our definition of HTML payload is much stricter than IE's
// definition and roughly the same as Firefox's definition.
@@ -542,12 +533,6 @@ static bool SniffForInvalidOfficeDocs(const char* content,
// Byte order marks
static const MagicNumber kMagicXML[] = {
- // We want to be very conservative in interpreting text/xml content as
- // XHTML -- we just want to sniff enough to make unit tests pass.
- // So we match explicitly on this, and don't match other ways of writing
- // it in semantically-equivalent ways.
- MAGIC_STRING("application/xhtml+xml",
- "<html xmlns=\"http://www.w3.org/1999/xhtml\""),
MAGIC_STRING("application/atom+xml", "<feed"),
MAGIC_STRING("application/rss+xml", "<rss"), // UTF-8
};
« no previous file with comments | « no previous file | net/base/mime_sniffer_unittest.cc » ('j') | net/base/mime_sniffer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698