Skip to content
Snippets Groups Projects
Verified Commit 0cf18a7d authored by Nika Layzell's avatar Nika Layzell Committed by Pier Angelo Vendrame
Browse files

Bug 1875248 - Check for network error preventing ExternalHelperAppService...

Bug 1875248 - Check for network error preventing ExternalHelperAppService before DONT_RETARGET, r=smaug

This reverts the change from 30cde47f9364e5c7da78fd08fa8ab21737d22399,
and instead re-orders the NS_ERROR_FILE_NOT_FOUND check before
DONT_RETARGET.

Testing suggests that a-download-click-404.html behaviour isn't
impacted, and this improves the handling of this edge-case when doing
process switching.

Differential Revision: https://phabricator.services.mozilla.com/D202007
parent ae62ceda
Branches
Tags
1 merge request!1135Bug 43084: Rebased stable onto 115.15.0esr
......@@ -414,26 +414,26 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest* request) {
NS_ASSERTION(!m_targetStreamListener,
"If we found a listener, why are we not using it?");
if (mFlags & nsIURILoader::DONT_RETARGET) {
LOG(
(" External handling forced or (listener not interested and no "
"stream converter exists), and retargeting disallowed -> aborting"));
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.
// The WPT a-download-click-404.html requires us to silently handle this
// without displaying an error page, so we just return early here.
// See bug 1604308 for discussion around what the ideal behaviour is.
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(request));
if (httpChannel) {
bool requestSucceeded;
rv = httpChannel->GetRequestSucceeded(&requestSucceeded);
if (NS_FAILED(rv) || !requestSucceeded) {
return NS_OK;
LOG(
(" Returning NS_ERROR_FILE_NOT_FOUND from "
"nsDocumentOpenInfo::DispatchContent due to failed HTTP response"));
return NS_ERROR_FILE_NOT_FOUND;
}
}
if (mFlags & nsIURILoader::DONT_RETARGET) {
LOG(
(" External handling forced or (listener not interested and no "
"stream converter exists), and retargeting disallowed -> aborting"));
return NS_ERROR_WONT_HANDLE_CONTENT;
}
// Fifth step:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment