From d3a6a84fb20730883f47a8201007989bf4d20260 Mon Sep 17 00:00:00 2001 From: Alexandru Marc Date: Sat, 21 Dec 2024 04:41:41 +0200 Subject: [PATCH] Backed out 4 changesets (bug 1325876) for causing wd failures @ navigation.spec.js CLOSED TREE Backed out changeset b29ef3f14bf7 (bug 1325876) Backed out changeset f8add6e2ef93 (bug 1325876) Backed out changeset 41cc884f84c1 (bug 1325876) Backed out changeset 014c9c77393a (bug 1325876) --- .../base/content/test/about/blank_page.sjs | 38 --------- browser/base/content/test/about/browser.toml | 5 -- .../about/browser_aboutNetError_blank_page.js | 77 ------------------- .../browser_aboutNetError_server_error.js | 9 --- ..._url_prefilled_normal_page_blank_target.js | 6 -- ...and_url_prefilled_normal_page_by_script.js | 6 -- ...and_url_prefilled_normal_page_no_target.js | 6 -- ..._url_prefilled_normal_page_other_target.js | 6 -- .../chrome/overrides/appstrings.properties | 1 - docshell/base/nsDocShell.cpp | 4 - dom/base/Document.cpp | 28 +------ .../en-US/chrome/appstrings.properties | 1 - .../browser_subdocument_downgrade.js | 2 - dom/webidl/NetErrorInfo.webidl | 2 - js/xpconnect/src/xpc.msg | 1 - modules/libpref/init/StaticPrefList.yaml | 13 ---- .../meta/loading/early-hints/__dir__.ini | 2 +- .../response-status-code.html.ini | 1 - toolkit/content/aboutNetError.mjs | 40 +--------- .../en-US/toolkit/neterror/certError.ftl | 1 - .../en-US/toolkit/neterror/netError.ftl | 7 -- tools/lint/fluent-lint/exclusions.yml | 1 - uriloader/base/nsURILoader.cpp | 17 ---- xpcom/base/ErrorList.py | 2 - 24 files changed, 8 insertions(+), 268 deletions(-) delete mode 100644 browser/base/content/test/about/blank_page.sjs delete mode 100644 browser/base/content/test/about/browser_aboutNetError_blank_page.js diff --git a/browser/base/content/test/about/blank_page.sjs b/browser/base/content/test/about/blank_page.sjs deleted file mode 100644 index 001fde31d391..000000000000 --- a/browser/base/content/test/about/blank_page.sjs +++ /dev/null @@ -1,38 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -function decode(str) { - return decodeURIComponent(str.replace(/\+/g, encodeURIComponent(" "))); -} - -function handleRequest(request, response) { - const queryString = request.queryString; - let params = queryString.split("&").reduce((memo, pair) => { - let [key, val] = pair.split("="); - if (!val) { - val = key; - key = "query"; - } - - try { - memo[decode(key)] = decode(val); - } catch (e) { - memo[key] = val; - } - - return memo; - }, {}); - - const status = parseInt(params.status); - const message = params.message; - - // Set default if missing parameters - if (!status || !message) { - response.setStatusLine(request.httpVersion, 400, "Bad Request"); - response.setHeader("Content-Length", "0", false); - return; - } - - response.setStatusLine(request.httpVersion, status, message); - response.setHeader("Content-Length", "0", false); -} diff --git a/browser/base/content/test/about/browser.toml b/browser/base/content/test/about/browser.toml index f6ec55de86fb..011ccc318d82 100644 --- a/browser/base/content/test/about/browser.toml +++ b/browser/base/content/test/about/browser.toml @@ -45,11 +45,6 @@ skip-if = [ ["browser_aboutNetError.js"] -["browser_aboutNetError_blank_page.js"] -support-files = [ - "blank_page.sjs", -] - ["browser_aboutNetError_csp_iframe.js"] https_first_disabled = true support-files = [ diff --git a/browser/base/content/test/about/browser_aboutNetError_blank_page.js b/browser/base/content/test/about/browser_aboutNetError_blank_page.js deleted file mode 100644 index 8b4b0aba5bb2..000000000000 --- a/browser/base/content/test/about/browser_aboutNetError_blank_page.js +++ /dev/null @@ -1,77 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ */ - -"use strict"; - -const BLANK_PAGE = - "https://example.com/browser/browser/base/content/test/about/blank_page.sjs"; - -async function test_blankPage( - page, - expectedL10nID, - responseStatus, - responseStatusText -) { - await SpecialPowers.pushPrefEnv({ - set: [["browser.http.blank_page_with_error_response.enabled", false]], - }); - - let browser; - let pageLoaded; - const uri = `${page}?status=${encodeURIComponent( - responseStatus - )}&message=${encodeURIComponent(responseStatusText)}`; - - // Simulating loading the page - await BrowserTestUtils.openNewForegroundTab( - gBrowser, - () => { - gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, uri); - browser = gBrowser.selectedBrowser; - pageLoaded = BrowserTestUtils.waitForErrorPage(browser); - }, - false - ); - - info("Loading and waiting for the net error"); - await pageLoaded; - - await SpecialPowers.spawn( - browser, - [expectedL10nID, responseStatus, responseStatusText], - function (l10nID, expectedStatus, expectedText) { - const doc = content.document; - ok( - doc.documentURI.startsWith("about:neterror"), - "Should be showing error page" - ); - - const titleEl = doc.querySelector(".title-text"); - const actualDataL10nID = titleEl.getAttribute("data-l10n-id"); - is(actualDataL10nID, l10nID, "Correct error page title is set"); - - const expectedLabel = - "Error code: " + expectedStatus.toString() + " " + expectedText; - const actualLabel = doc.getElementById( - "response-status-label" - ).textContent; - is(actualLabel, expectedLabel, "Correct response status message is set"); - } - ); - - BrowserTestUtils.removeTab(gBrowser.selectedTab); - await SpecialPowers.popPrefEnv(); -} - -add_task(async function test_blankPage_4xx() { - await test_blankPage(BLANK_PAGE, "httpErrorPage-title", 400, "Bad Request"); -}); - -add_task(async function test_blankPage_5xx() { - await test_blankPage( - BLANK_PAGE, - "serverError-title", - 503, - "Service Unavailable" - ); -}); diff --git a/browser/base/content/test/about/browser_aboutNetError_server_error.js b/browser/base/content/test/about/browser_aboutNetError_server_error.js index 7bab8416e502..cf55f6701772 100644 --- a/browser/base/content/test/about/browser_aboutNetError_server_error.js +++ b/browser/base/content/test/about/browser_aboutNetError_server_error.js @@ -39,15 +39,6 @@ add_task(async function test_serverError() { "serverError-title", "Correct error page title is set" ); - - const responseStatusLabel = doc.getElementById( - "response-status-label" - ).textContent; - is( - responseStatusLabel, - "Error code: 500 Internal Server Error", - "Correct response status message is set" - ); }); BrowserTestUtils.removeTab(gBrowser.selectedTab); diff --git a/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_blank_target.js b/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_blank_target.js index d6b2da2fe7b4..84f18db36565 100644 --- a/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_blank_target.js +++ b/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_blank_target.js @@ -15,12 +15,6 @@ Services.scriptloader.loadSubScript( this ); -add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["browser.http.blank_page_with_error_response.enabled", true]], - }); -}); - add_task(async function normal_page__foreground__click() { await doTestInSameWindow({ link: "wait-a-bit--blank-target", diff --git a/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_by_script.js b/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_by_script.js index 33ccf1271ab5..37d3379e9107 100644 --- a/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_by_script.js +++ b/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_by_script.js @@ -14,12 +14,6 @@ const { UrlbarTestUtils } = ChromeUtils.importESModule( "resource://testing-common/UrlbarTestUtils.sys.mjs" ); -add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["browser.http.blank_page_with_error_response.enabled", true]], - }); -}); - add_task(async function normal_page__by_script() { await doTestInSameWindow({ link: "wait-a-bit--by-script", diff --git a/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_no_target.js b/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_no_target.js index eac69269a4c7..469e33478e89 100644 --- a/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_no_target.js +++ b/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_no_target.js @@ -15,12 +15,6 @@ const { UrlbarTestUtils } = ChromeUtils.importESModule( "resource://testing-common/UrlbarTestUtils.sys.mjs" ); -add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["browser.http.blank_page_with_error_response.enabled", true]], - }); -}); - add_task(async function normal_page__no_target() { await doTestInSameWindow({ link: "wait-a-bit--no-target", diff --git a/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_other_target.js b/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_other_target.js index 8accb87e7127..bd6e3a31b52c 100644 --- a/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_other_target.js +++ b/browser/components/tabbrowser/test/browser/tabs/browser_link_in_tab_title_and_url_prefilled_normal_page_other_target.js @@ -15,12 +15,6 @@ Services.scriptloader.loadSubScript( this ); -add_setup(async function () { - await SpecialPowers.pushPrefEnv({ - set: [["browser.http.blank_page_with_error_response.enabled", true]], - }); -}); - add_task(async function normal_page__other_target__foreground() { await doTestInSameWindow({ link: "wait-a-bit--other-target", diff --git a/browser/locales/en-US/chrome/overrides/appstrings.properties b/browser/locales/en-US/chrome/overrides/appstrings.properties index 412ec7ba2b36..d572ac39c657 100644 --- a/browser/locales/en-US/chrome/overrides/appstrings.properties +++ b/browser/locales/en-US/chrome/overrides/appstrings.properties @@ -6,7 +6,6 @@ malformedURI2=Please check that the URL is correct and try again. fileNotFound=Firefox can’t find the file at %S. fileAccessDenied=The file at %S is not readable. # %S is replaced by the uri host -httpErrorPage=%S sent back an error. serverError=%S might have a temporary problem or it could have moved. dnsNotFound2=We can’t connect to the server at %S. unknownProtocolFound=Firefox doesn’t know how to open this address, because one of the following protocols (%S) isn’t associated with any program or is not allowed in this context. diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index a97b0c708c37..2ece88b9a272 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -3353,9 +3353,6 @@ 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"; @@ -6105,7 +6102,6 @@ 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 || diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp index 217fc5f20c61..f3f132ae3f1a 100644 --- a/dom/base/Document.cpp +++ b/dom/base/Document.cpp @@ -1667,30 +1667,16 @@ void Document::GetNetErrorInfo(NetErrorInfo& aInfo, ErrorResult& aRv) { return; } - nsCOMPtr httpChannel(do_QueryInterface(mFailedChannel)); - - // We don't throw even if httpChannel is null, we just keep responseStatus and - // responseStatusText empty - if (httpChannel) { - uint32_t responseStatus; - nsAutoCString responseStatusText; - rv = httpChannel->GetResponseStatus(&responseStatus); - if (NS_SUCCEEDED(rv)) { - aInfo.mResponseStatus = responseStatus; - } - - rv = httpChannel->GetResponseStatusText(responseStatusText); - if (NS_SUCCEEDED(rv)) { - aInfo.mResponseStatusText.AssignASCII(responseStatusText); - } - } - nsCOMPtr tsi; rv = mFailedChannel->GetSecurityInfo(getter_AddRefs(tsi)); if (NS_WARN_IF(NS_FAILED(rv))) { aRv.Throw(rv); return; } + if (NS_WARN_IF(!tsi)) { + aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); + return; + } nsresult channelStatus; rv = mFailedChannel->GetStatus(&channelStatus); @@ -1700,12 +1686,6 @@ void Document::GetNetErrorInfo(NetErrorInfo& aInfo, ErrorResult& aRv) { } aInfo.mChannelStatus = static_cast(channelStatus); - // If nsITransportSecurityInfo is not set, simply keep the remaining fields - // empty (to make responseStatus and responseStatusText accessible). - if (!tsi) { - return; - } - // TransportSecurityInfo::GetErrorCodeString always returns NS_OK (void)tsi->GetErrorCodeString(aInfo.mErrorCodeString); if (aInfo.mErrorCodeString.IsEmpty()) { diff --git a/dom/locales/en-US/chrome/appstrings.properties b/dom/locales/en-US/chrome/appstrings.properties index e3f749b4b80d..aa7bbda90735 100644 --- a/dom/locales/en-US/chrome/appstrings.properties +++ b/dom/locales/en-US/chrome/appstrings.properties @@ -6,7 +6,6 @@ malformedURI2=Please check that the URL is correct and try again. fileNotFound=The file %S cannot be found. Please check the location and try again. fileAccessDenied=The file at %S is not readable. # %S is replaced by the uri host -httpErrorPage=%S sent back an error. serverError=%S might have a temporary problem or it could have moved. dnsNotFound2=%S could not be found. Please check the name and try again. unknownProtocolFound=One of the following (%S) is not a registered protocol or is not allowed in this context. diff --git a/dom/security/test/https-first/browser_subdocument_downgrade.js b/dom/security/test/https-first/browser_subdocument_downgrade.js index dee8d59f87ba..4cb5b4ed2ef6 100644 --- a/dom/security/test/https-first/browser_subdocument_downgrade.js +++ b/dom/security/test/https-first/browser_subdocument_downgrade.js @@ -15,8 +15,6 @@ add_task(async function test_subdocument_downgrade() { ["dom.security.https_first", true], // Makes it easier to detect the error ["security.mixed_content.block_active_content", false], - // Avoid error page for empty file (blank page with 429) - ["browser.http.blank_page_with_error_response.enabled", true], ], }); diff --git a/dom/webidl/NetErrorInfo.webidl b/dom/webidl/NetErrorInfo.webidl index 76f07b6bafc0..73a01eb1bb3c 100644 --- a/dom/webidl/NetErrorInfo.webidl +++ b/dom/webidl/NetErrorInfo.webidl @@ -12,6 +12,4 @@ dictionary NetErrorInfo { DOMString errorCodeString = ""; unsigned long channelStatus = 0; - unsigned long responseStatus = 0; - DOMString responseStatusText = ""; }; diff --git a/js/xpconnect/src/xpc.msg b/js/xpconnect/src/xpc.msg index 8ffab7dcbe62..7a448562f8ef 100644 --- a/js/xpconnect/src/xpc.msg +++ b/js/xpconnect/src/xpc.msg @@ -157,7 +157,6 @@ XPC_MSG_DEF(NS_ERROR_NET_TIMEOUT_EXTERNAL , "The request has been canc XPC_MSG_DEF(NS_ERROR_OFFLINE , "The requested action could not be completed in the offline state") XPC_MSG_DEF(NS_ERROR_PORT_ACCESS_NOT_ALLOWED , "Establishing a connection to an unsafe or otherwise banned port was prohibited") XPC_MSG_DEF(NS_ERROR_NET_RESET , "The connection was established, but no data was ever received") -XPC_MSG_DEF(NS_ERROR_NET_EMPTY_RESPONSE , "The connection was established, but the browser received an empty page with an error response") XPC_MSG_DEF(NS_ERROR_NET_ERROR_RESPONSE , "The connection was established, but the browser received an error response from the server") XPC_MSG_DEF(NS_ERROR_NET_INTERRUPT , "The connection was established, but the data transfer was interrupted") XPC_MSG_DEF(NS_ERROR_NET_PARTIAL_TRANSFER , "A transfer was only partially done when it completed") diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index ff8547aee9b3..2898fab10fed 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -1570,19 +1570,6 @@ value: false mirror: always -# If false, show internal error page for HTTP responses with error -# codes (4xx, 5xx) and "Content-Length": 0 instead of blank page -# See https://bugzilla.mozilla.org/show_bug.cgi?id=1325876#c32 for why this -# is disabled on Android. -- name: browser.http.blank_page_with_error_response.enabled - type: bool -#if !defined(ANDROID) - value: false -#else - value: true -#endif - mirror: always - # The minimum area for a rect to be included in a wireframe, in CSS pixels. # # The current value of 50 is pretty arbitrary, and will be tuned as we refine diff --git a/testing/web-platform/meta/loading/early-hints/__dir__.ini b/testing/web-platform/meta/loading/early-hints/__dir__.ini index f914eb7f9556..a771d37f9764 100644 --- a/testing/web-platform/meta/loading/early-hints/__dir__.ini +++ b/testing/web-platform/meta/loading/early-hints/__dir__.ini @@ -1,3 +1,3 @@ -prefs: [network.early-hints.enabled: true, browser.http.blank_page_with_error_response.enabled: true] +prefs: [network.early-hints.enabled: true] leak-threshold: [tab:358400] lsan-allowed: [Alloc, AllocateProtoAndIfaceCache, createTable, mozilla::detail::HashTable] diff --git a/testing/web-platform/meta/resource-timing/response-status-code.html.ini b/testing/web-platform/meta/resource-timing/response-status-code.html.ini index 04e0a257a784..d3ddc253242d 100644 --- a/testing/web-platform/meta/resource-timing/response-status-code.html.ini +++ b/testing/web-platform/meta/resource-timing/response-status-code.html.ini @@ -3,7 +3,6 @@ if not debug and (os == "android") and sessionHistoryInParent: [OK, TIMEOUT] if not debug and (os == "android") and not sessionHistoryInParent: [OK, TIMEOUT] if debug: TIMEOUT - prefs: [browser.http.blank_page_with_error_response.enabled:true] [This test validates the response status of resources.] expected: if (os == "android") and not debug: [PASS, FAIL] diff --git a/toolkit/content/aboutNetError.mjs b/toolkit/content/aboutNetError.mjs index 2d3f03e93881..2f899f9b458e 100644 --- a/toolkit/content/aboutNetError.mjs +++ b/toolkit/content/aboutNetError.mjs @@ -46,7 +46,6 @@ const KNOWN_ERROR_TITLE_IDS = new Set([ "unsafeContentType-title", "netReset-title", "netTimeout-title", - "httpErrorPage-title", "serverError-title", "unknownProtocolFound-title", "proxyConnectFailure-title", @@ -266,32 +265,6 @@ function recordTRREventTelemetry( } } -function setResponseStatus(shortDesc) { - let responseStatus; - let responseStatusText; - try { - const netErrorInfo = document.getNetErrorInfo(); - responseStatus = netErrorInfo.responseStatus; - responseStatusText = netErrorInfo.responseStatusText; - } catch (ex) { - return; - } - - if (responseStatus >= 400) { - let responseStatusLabel = document.createElement("p"); - responseStatusLabel.id = "response-status-label"; // id for testing - document.l10n.setAttributes( - responseStatusLabel, - "neterror-response-status-code", - { - responsestatus: responseStatus, - responsestatustext: responseStatusText ?? "", - } - ); - shortDesc.appendChild(responseStatusLabel); - } -} - function initPage() { // We show an offline support page in case of a system-wide error, // when a user cannot connect to the internet and access the SUMO website. @@ -622,7 +595,6 @@ function initPage() { setNetErrorMessageFromParts(longDesc, parts); } - setResponseStatus(shortDesc); setNetErrorMessageFromCode(); } @@ -745,7 +717,8 @@ function getNetErrorDescParts() { case "connectionFailure": case "netInterrupt": case "netReset": - case "netTimeout": { + case "netTimeout": + case "serverError": { let errorTags = [ ["li", "neterror-load-error-try-again"], ["li", "neterror-load-error-connection"], @@ -757,10 +730,6 @@ function getNetErrorDescParts() { return errorTags; } - case "httpErrorPage": // 4xx - return [["li", "neterror-http-error-page"]]; - case "serverError": // 5xx - return [["li", "neterror-load-error-try-again"]]; case "blockedByPolicy": case "deniedPortAccess": case "malformedURI": @@ -855,10 +824,7 @@ function setNetErrorMessageFromCode() { try { errorCode = document.getNetErrorInfo().errorCodeString; } catch (ex) { - return; - } - - if (!errorCode) { + // We don't have a securityInfo when this is for example a DNS error. return; } diff --git a/toolkit/locales/en-US/toolkit/neterror/certError.ftl b/toolkit/locales/en-US/toolkit/neterror/certError.ftl index 1172c0193f79..612d18ac3f79 100644 --- a/toolkit/locales/en-US/toolkit/neterror/certError.ftl +++ b/toolkit/locales/en-US/toolkit/neterror/certError.ftl @@ -129,7 +129,6 @@ contentEncodingError-title = Content Encoding Error unsafeContentType-title = Unsafe File Type netReset-title = The connection was reset netTimeout-title = The connection has timed out -httpErrorPage-title = Looks like there’s a problem with this site serverError-title = Looks like there’s a problem with this site unknownProtocolFound-title = The address wasn’t understood proxyConnectFailure-title = The proxy server is refusing connections diff --git a/toolkit/locales/en-US/toolkit/neterror/netError.ftl b/toolkit/locales/en-US/toolkit/neterror/netError.ftl index a061dbe21852..41d9c67d16e1 100644 --- a/toolkit/locales/en-US/toolkit/neterror/netError.ftl +++ b/toolkit/locales/en-US/toolkit/neterror/netError.ftl @@ -44,8 +44,6 @@ neterror-load-error-firewall = If your computer or network is protected by a fir # This warning is only shown on macOS Sequoia and later (see bug 1929377) neterror-load-osx-permission = If you are trying to load a local network page, please check that { -brand-short-name } has been granted Local Network permissions in the macOS Privacy & Security settings. -neterror-http-error-page = Check to make sure you’ve typed the website address correctly. - neterror-captive-portal = You must log in to this network before you can access the internet. # Variables: @@ -180,8 +178,3 @@ certerror-mitm-what-can-you-do-about-it-attack-sts = If you are not familiar wit certerror-what-should-i-do-bad-sts-cert-explanation = { $hostname } has a security policy called HTTP Strict Transport Security (HSTS), which means that { -brand-short-name } can only connect to it securely. You can’t add an exception to visit this site. cert-error-trust-certificate-transparency-what-can-you-do-about-it = Probably nothing, since it’s likely there’s a problem with the site itself. - -# Variables: -# $responsestatus (string) - HTTP response status code (e.g., 500). -# $responsestatustext (string) - HTTP response status text (e.g., "Internal Server Error"). -neterror-response-status-code = Error code: { $responsestatus } { $responsestatustext } diff --git a/tools/lint/fluent-lint/exclusions.yml b/tools/lint/fluent-lint/exclusions.yml index f067721dc659..cbe604e181da 100644 --- a/tools/lint/fluent-lint/exclusions.yml +++ b/tools/lint/fluent-lint/exclusions.yml @@ -63,7 +63,6 @@ ID01: - unsafeContentType-title - netReset-title - netTimeout-title - - httpErrorPage-title - serverError-title - unknownProtocolFound-title - proxyConnectFailure-title diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp index e3f714946069..490674c18221 100644 --- a/uriloader/base/nsURILoader.cpp +++ b/uriloader/base/nsURILoader.cpp @@ -131,23 +131,6 @@ NS_IMETHODIMP nsDocumentOpenInfo::OnStartRequest(nsIRequest* request) { if (204 == responseCode || 205 == responseCode) { return NS_BINDING_ABORTED; } - - if (!mozilla::StaticPrefs:: - browser_http_blank_page_with_error_response_enabled()) { - // Bug 1325876: Show internal error page for HTTP responses with error - // codes (4xx, 5xx) and "Content-Length": 0 instead of blank page - int64_t contentLength = 0; - rv = httpChannel->GetContentLength(&contentLength); - - if (NS_FAILED(rv) || contentLength <= 0) { - if (responseCode >= 500) { - return NS_ERROR_NET_ERROR_RESPONSE; - } - if (responseCode >= 400) { - return NS_ERROR_NET_EMPTY_RESPONSE; - } - } - } } // diff --git a/xpcom/base/ErrorList.py b/xpcom/base/ErrorList.py index 45a2f0c06a53..a20409a23ebe 100755 --- a/xpcom/base/ErrorList.py +++ b/xpcom/base/ErrorList.py @@ -327,8 +327,6 @@ with modules["NETWORK"]: errors["NS_ERROR_NET_RESET"] = FAILURE(20) # The connection was established, but browser received an error response from the server errors["NS_ERROR_NET_ERROR_RESPONSE"] = FAILURE(35) - # The connection was established, but browser received an empty page with 4xx, 5xx error response - errors["NS_ERROR_NET_EMPTY_RESPONSE"] = FAILURE(36) # The connection was established, but the data transfer was interrupted. errors["NS_ERROR_NET_INTERRUPT"] = FAILURE(71) # The connection attempt to a proxy failed.