Bug 1708125 - Remove some remaining FTP references from the tree r=necko-reviewers,dragana,Gijs

Differential Revision: https://phabricator.services.mozilla.com/D114067
This commit is contained in:
Valentin Gosu 2021-05-31 13:08:12 +00:00
Родитель 0b4418c6a7
Коммит 7c670aecf4
11 изменённых файлов: 7 добавлений и 78 удалений

Просмотреть файл

@ -202,14 +202,6 @@
<string>https</string>
</array>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>ftp URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>ftp</string>
</array>
</dict>
<dict>
<key>CFBundleURLName</key>
<string>file URL</string>

Просмотреть файл

@ -1130,6 +1130,6 @@ function checkProtocol(img) {
var url = img[COL_IMAGE_ADDRESS];
return (
/^data:image\//i.test(url) ||
/^(https?|ftp|file|about|chrome|resource):/.test(url)
/^(https?|file|about|chrome|resource):/.test(url)
);
}

Просмотреть файл

@ -219,7 +219,6 @@ const kProtocolsWithIcons = [
"about:",
"http:",
"https:",
"ftp:",
];
function iconHelper(url) {
if (typeof url == "string") {

Просмотреть файл

@ -5,7 +5,7 @@
testEngine_setup();
add_task(async function test_protocol_trimming() {
for (let prot of ["http", "https", "ftp"]) {
for (let prot of ["http", "https"]) {
let visit = {
// Include the protocol in the query string to ensure we get matches (see bug 1059395)
uri: Services.io.newURI(

Просмотреть файл

@ -147,52 +147,6 @@ add_task(async function test_untrimmed_www_path() {
await cleanupPlaces();
});
add_task(async function test_untrimmed_ftp() {
info("Searching for untrimmed ftp:// entry");
await PlacesTestUtils.addVisits({
uri: Services.io.newURI("ftp://mozilla.org/test/"),
});
let context = createContext("mo", { isPrivate: false });
await check_results({
context,
autofilled: "mozilla.org/",
completed: "ftp://mozilla.org/",
matches: [
makeVisitResult(context, {
uri: "ftp://mozilla.org/",
title: "ftp://mozilla.org",
heuristic: true,
}),
makeVisitResult(context, {
uri: "ftp://mozilla.org/test/",
title: "test visit for ftp://mozilla.org/test/",
}),
],
});
await cleanupPlaces();
});
add_task(async function test_untrimmed_ftp_path() {
info("Searching for untrimmed ftp:// entry with path");
await PlacesTestUtils.addVisits({
uri: Services.io.newURI("ftp://mozilla.org/test/"),
});
let context = createContext("mozilla.org/t", { isPrivate: false });
await check_results({
context,
autofilled: "mozilla.org/test/",
completed: "ftp://mozilla.org/test/",
matches: [
makeVisitResult(context, {
uri: "ftp://mozilla.org/test/",
title: "ftp://mozilla.org/test/",
heuristic: true,
}),
],
});
await cleanupPlaces();
});
add_task(async function test_escaped_chars() {
info("Searching for URL with characters that are normally escaped");
await PlacesTestUtils.addVisits({

Просмотреть файл

@ -89,7 +89,7 @@ const {
FIXUP_FLAG_FIX_SCHEME_TYPOS,
} = Ci.nsIURIFixup;
const COMMON_PROTOCOLS = ["http", "https", "ftp", "file"];
const COMMON_PROTOCOLS = ["http", "https", "file"];
// Regex used to identify user:password tokens in url strings.
// This is not a strict valid characters check, because we try to fixup this

Просмотреть файл

@ -2513,7 +2513,6 @@ class Document : public nsINode,
return !NodePrincipal()->SchemeIs("http") &&
!NodePrincipal()->SchemeIs("https") &&
!NodePrincipal()->SchemeIs("ftp") &&
!NodePrincipal()->SchemeIs("file");
}

Просмотреть файл

@ -257,8 +257,7 @@ bool ReferrerInfo::IsReferrerSchemeAllowed(nsIURI* aReferrer) {
return false;
}
return scheme.EqualsIgnoreCase("https") || scheme.EqualsIgnoreCase("http") ||
scheme.EqualsIgnoreCase("ftp");
return scheme.EqualsIgnoreCase("https") || scheme.EqualsIgnoreCase("http");
}
/* static */
@ -1199,7 +1198,7 @@ nsresult ReferrerInfo::ComputeReferrer(nsIHttpChannel* aChannel) {
return NS_OK;
}
// Enforce Referrer allowlist, only http, https, ftp scheme are allowed
// Enforce Referrer allowlist, only http, https scheme are allowed
if (!IsReferrerSchemeAllowed(mOriginalReferrer)) {
return NS_OK;
}

Просмотреть файл

@ -154,7 +154,7 @@ class ReferrerInfo : public nsIReferrerInfo {
/**
* Check whether the given referrer's scheme is allowed to be computed and
* sent. The allowlist schemes are: http, https, ftp.
* sent. The allowlist schemes are: http, https.
*/
static bool IsReferrerSchemeAllowed(nsIURI* aReferrer);
@ -368,7 +368,7 @@ class ReferrerInfo : public nsIReferrerInfo {
bool IsPolicyOverrided() { return mOverridePolicyByDefault; }
/*
* Get origin string from a given valid referrer URI (http, https, ftp)
* Get origin string from a given valid referrer URI (http, https)
*
* @aReferrer - the full referrer URI
* @aResult - the resulting aReferrer in string format.

Просмотреть файл

@ -14,9 +14,6 @@
12=Performing a TLS handshake to %1$S…
13=The TLS handshake finished for %1$S…
27=Beginning FTP transaction…
28=Finished FTP transaction
RepostFormData=This web page is being redirected to a new location. Would you like to resend the form data you have typed to the new location?
# Directory listing strings

Просмотреть файл

@ -428,17 +428,6 @@ add_task(async function test_windows_zoneInformation() {
httpSourceUrl +
"\r\n",
},
{
options: {
referrerInfo: createReferrerInfo("ftp://user:pass@example.com/"),
},
expectedZoneId:
"[ZoneTransfer]\r\nZoneId=3\r\n" +
"ReferrerUrl=ftp://example.com/\r\n" +
"HostUrl=" +
httpSourceUrl +
"\r\n",
},
{
options: { isPrivate: true },
expectedZoneId: "[ZoneTransfer]\r\nZoneId=3\r\n",