From c304ad071866f0cf94e49f3370bfb8b5b5653437 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 2 Dec 2009 23:56:59 -0500 Subject: [PATCH] Bug 455472. Be a little more careful with our handling of application/octet-stream. r=jst --- content/base/src/nsObjectLoadingContent.cpp | 8 +++- content/base/test/Makefile.in | 1 + content/base/test/test_bug455472.html | 42 +++++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 content/base/test/test_bug455472.html diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index 8ab742ace6c..da9f98e981f 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -414,11 +414,15 @@ nsObjectLoadingContent::OnStartRequest(nsIRequest *aRequest, // true: // // 1) The channel type is application/octet-stream and we have a - // type hint + // type hint and the type hint is not a document type. // 2) Our type hint is a type that we support with a plugin. if ((channelType.EqualsASCII(APPLICATION_OCTET_STREAM) && - !mContentType.IsEmpty()) || + !mContentType.IsEmpty() && + GetTypeOfContent(mContentType) != eType_Document) || + // Need to check IsSupportedPlugin() in addition to GetTypeOfContent() + // because otherwise the default plug-in's catch-all behavior would + // confuse things. (IsSupportedPlugin(mContentType) && GetTypeOfContent(mContentType) == eType_Plugin)) { // Set the type we'll use for dispatch on the channel. Otherwise we could diff --git a/content/base/test/Makefile.in b/content/base/test/Makefile.in index 404a05c90ea..9e92c7648e0 100644 --- a/content/base/test/Makefile.in +++ b/content/base/test/Makefile.in @@ -299,6 +299,7 @@ _TEST_FILES = test_bug5141.html \ test_bug444322.html \ bug444322.txt \ bug444322.js \ + test_bug455472.html \ test_bug455629.html \ bug455629-helper.svg \ test_bug473162-1.html \ diff --git a/content/base/test/test_bug455472.html b/content/base/test/test_bug455472.html new file mode 100644 index 00000000000..fddbd283cc0 --- /dev/null +++ b/content/base/test/test_bug455472.html @@ -0,0 +1,42 @@ + + + + + Test for Bug 455472 + + + + + +Mozilla Bug 455472 +

+ + +
+
+
+ +