зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8fea79dcd428 (bug 1708125) for causing xpcshell failures in test_DownloadCore.js.
CLOSED TREE
This commit is contained in:
Родитель
6ac5d624e0
Коммит
2a324428d6
|
@ -202,6 +202,14 @@
|
|||
<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?|file|about|chrome|resource):/.test(url)
|
||||
/^(https?|ftp|file|about|chrome|resource):/.test(url)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -219,6 +219,7 @@ 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"]) {
|
||||
for (let prot of ["http", "https", "ftp"]) {
|
||||
let visit = {
|
||||
// Include the protocol in the query string to ensure we get matches (see bug 1059395)
|
||||
uri: Services.io.newURI(
|
||||
|
|
|
@ -147,6 +147,52 @@ 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", "file"];
|
||||
const COMMON_PROTOCOLS = ["http", "https", "ftp", "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,6 +2513,7 @@ class Document : public nsINode,
|
|||
|
||||
return !NodePrincipal()->SchemeIs("http") &&
|
||||
!NodePrincipal()->SchemeIs("https") &&
|
||||
!NodePrincipal()->SchemeIs("ftp") &&
|
||||
!NodePrincipal()->SchemeIs("file");
|
||||
}
|
||||
|
||||
|
|
|
@ -257,7 +257,8 @@ bool ReferrerInfo::IsReferrerSchemeAllowed(nsIURI* aReferrer) {
|
|||
return false;
|
||||
}
|
||||
|
||||
return scheme.EqualsIgnoreCase("https") || scheme.EqualsIgnoreCase("http");
|
||||
return scheme.EqualsIgnoreCase("https") || scheme.EqualsIgnoreCase("http") ||
|
||||
scheme.EqualsIgnoreCase("ftp");
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@ -1198,7 +1199,7 @@ nsresult ReferrerInfo::ComputeReferrer(nsIHttpChannel* aChannel) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// Enforce Referrer allowlist, only http, https scheme are allowed
|
||||
// Enforce Referrer allowlist, only http, https, ftp 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.
|
||||
* sent. The allowlist schemes are: http, https, ftp.
|
||||
*/
|
||||
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)
|
||||
* Get origin string from a given valid referrer URI (http, https, ftp)
|
||||
*
|
||||
* @aReferrer - the full referrer URI
|
||||
* @aResult - the resulting aReferrer in string format.
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
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
|
||||
|
|
Загрузка…
Ссылка в новой задаче