Bug 1325876 - Add a pref for showing internal error page for HTTP responses with error codes (4xx, 5xx) and Content-Length: 0 instead of blank page r=manuel,necko-reviewers,fluent-reviewers,jesup,bolsson,valentin,kershaw

Differential Revision: https://phabricator.services.mozilla.com/D220193
This commit is contained in:
Sean
2025-01-27 21:05:42 +00:00
parent b45af8c387
commit c73aeda52c
11 changed files with 45 additions and 2 deletions

View File

@@ -3354,6 +3354,9 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
nestedURI = do_QueryInterface(tempURI);
}
error = "unknownProtocolFound";
} else if (NS_ERROR_NET_EMPTY_RESPONSE == aError) {
NS_ENSURE_ARG_POINTER(aURI);
error = "httpErrorPage";
} else if (NS_ERROR_NET_ERROR_RESPONSE == aError) {
NS_ENSURE_ARG_POINTER(aURI);
error = "serverError";
@@ -6111,6 +6114,7 @@ nsresult nsDocShell::FilterStatusForErrorPage(
if (aStatus == NS_ERROR_NET_TIMEOUT ||
aStatus == NS_ERROR_NET_TIMEOUT_EXTERNAL ||
aStatus == NS_ERROR_NET_EMPTY_RESPONSE ||
aStatus == NS_ERROR_NET_ERROR_RESPONSE ||
aStatus == NS_ERROR_PROXY_GATEWAY_TIMEOUT ||
aStatus == NS_ERROR_REDIRECT_LOOP ||