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

Unified Diff: net/base/mime_sniffer_unittest.cc

Issue 465048: net: Ignore the magic number sniffer if it determines an application/octet-st... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: with additional comment Created 11 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 | « net/base/mime_sniffer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_sniffer_unittest.cc
===================================================================
--- net/base/mime_sniffer_unittest.cc (revision 33698)
+++ net/base/mime_sniffer_unittest.cc (working copy)
@@ -88,6 +88,14 @@
};
TestArray(tests, arraysize(tests));
+
+ // Don't sniff Linux installers with embedded shell scripts as text/plain.
+ std::string content = "#!/bin/bash\necho hi\n";
+ content.resize(5000, '\n');
+ content.resize(20000, '\xFD');
+ EXPECT_EQ("application/octet-stream",
+ SniffMimeType(content, "http://www.example.com/foo.bin",
+ "application/octet-stream"));
}
TEST(MimeSnifferTest, ChromeExtensionsTest) {
« no previous file with comments | « net/base/mime_sniffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698