From 2cab058f54572237194ba45c5c718f4b70d5303b Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 27 Apr 2006 18:00:36 +0000 Subject: [PATCH] Don't go out to the helper app service if we're dealing with an error page. Bug 312727, r=biesi, sr=darin git-svn-id: svn://10.0.0.236/trunk@195577 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/uriloader/base/nsURILoader.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mozilla/uriloader/base/nsURILoader.cpp b/mozilla/uriloader/base/nsURILoader.cpp index 0da26c7d31f..56c0495672e 100644 --- a/mozilla/uriloader/base/nsURILoader.cpp +++ b/mozilla/uriloader/base/nsURILoader.cpp @@ -612,6 +612,18 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports * return NS_ERROR_WONT_HANDLE_CONTENT; } + // Before dispatching to the external helper app service, check for an HTTP + // error page. If we got one, we don't want to handle it with a helper app, + // really. + if (httpChannel) { + PRBool requestSucceeded; + httpChannel->GetRequestSucceeded(&requestSucceeded); + if (!requestSucceeded) { + // returning error from OnStartRequest will cancel the channel + return NS_ERROR_FILE_NOT_FOUND; + } + } + // Sixth step: // // All attempts to dispatch this content have failed. Just pass it off to