Bug 1598516 - Handle malformed uri load error with an error page. r=kmag
Previously this error occurred synchronously during AsyncOpen, and we handled it there. With DocumentChannel we don't find out until it's handled in the parent, so the error is returned to the docshell via a failed status on the request. Differential Revision: https://phabricator.services.mozilla.com/D54248
This commit is contained in:
@@ -3687,6 +3687,9 @@ NS_IMETHODIMP
|
||||
nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
|
||||
const char16_t* aURL, nsIChannel* aFailedChannel,
|
||||
bool* aDisplayedErrorPage) {
|
||||
MOZ_LOG(gDocShellLeakLog, LogLevel::Debug,
|
||||
("DOCSHELL %p DisplayLoadError %s\n", this,
|
||||
aURI ? aURI->GetSpecOrDefault().get() : ""));
|
||||
// If we have a cross-process parent document, we must notify it that we no
|
||||
// longer block its load event. This is necessary for OOP sub-documents
|
||||
// because error documents do not result in a call to
|
||||
@@ -6214,6 +6217,9 @@ nsDocShell::OnContentBlockingEvent(nsIWebProgress* aWebProgress,
|
||||
|
||||
nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
|
||||
nsIChannel* aChannel, nsresult aStatus) {
|
||||
MOZ_LOG(gDocShellLeakLog, LogLevel::Debug,
|
||||
("DOCSHELL %p EndPageLoad status: %" PRIx32 "\n", this,
|
||||
static_cast<uint32_t>(aStatus)));
|
||||
if (!aChannel) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
@@ -6553,6 +6559,7 @@ nsresult nsDocShell::EndPageLoad(nsIWebProgress* aProgress,
|
||||
aStatus == NS_ERROR_PROXY_CONNECTION_REFUSED ||
|
||||
aStatus == NS_ERROR_PROXY_AUTHENTICATION_FAILED ||
|
||||
aStatus == NS_ERROR_PROXY_TOO_MANY_REQUESTS ||
|
||||
aStatus == NS_ERROR_MALFORMED_URI ||
|
||||
aStatus == NS_ERROR_BLOCKED_BY_POLICY) &&
|
||||
(isTopFrame || UseErrorPages())) {
|
||||
DisplayLoadError(aStatus, url, nullptr, aChannel);
|
||||
|
||||
Reference in New Issue
Block a user