Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 89d37d1

Browse files
committed
Bug 1574475 - Remove FTP proxy code r=necko-reviewers,preferences-reviewers,mixedpuppy,mkaply,dragana
Differential Revision: https://phabricator.services.mozilla.com/D111248
1 parent cab101e commit 89d37d1

File tree

16 files changed

+51
-155
lines changed

16 files changed

+51
-155
lines changed

browser/components/enterprisepolicies/helpers/ProxyPolicies.jsm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ var ProxyPolicies = {
7272
);
7373
}
7474

75+
if (param.FTPProxy) {
76+
log.warn("FTPProxy support was removed in bug 1574475");
77+
}
78+
7579
function setProxyHostAndPort(type, address) {
7680
let url;
7781
try {
@@ -96,14 +100,10 @@ var ProxyPolicies = {
96100
// network code. That pref only controls if the checkbox is checked, and
97101
// then we must manually set the other values.
98102
if (param.UseHTTPProxyForAllProtocols) {
99-
param.FTPProxy = param.SSLProxy = param.SOCKSProxy = param.HTTPProxy;
103+
param.SSLProxy = param.SOCKSProxy = param.HTTPProxy;
100104
}
101105
}
102106

103-
if (param.FTPProxy) {
104-
setProxyHostAndPort("ftp", param.FTPProxy);
105-
}
106-
107107
if (param.SSLProxy) {
108108
setProxyHostAndPort("ssl", param.SSLProxy);
109109
}

browser/components/enterprisepolicies/tests/xpcshell/test_proxy.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,13 @@ add_task(async function test_proxy_addresses() {
7979
policies: {
8080
Proxy: {
8181
HTTPProxy: "http.proxy.example.com:10",
82-
FTPProxy: "ftp.proxy.example.com:20",
8382
SSLProxy: "ssl.proxy.example.com:30",
8483
SOCKSProxy: "socks.proxy.example.com:40",
8584
},
8685
},
8786
});
8887

8988
checkProxyPref("http", "http.proxy.example.com", 10);
90-
checkProxyPref("ftp", "ftp.proxy.example.com", 20);
9189
checkProxyPref("ssl", "ssl.proxy.example.com", 30);
9290
checkProxyPref("socks", "socks.proxy.example.com", 40);
9391

@@ -97,6 +95,8 @@ add_task(async function test_proxy_addresses() {
9795
policies: {
9896
Proxy: {
9997
HTTPProxy: "http.proxy.example.com:10",
98+
// FTP support was removed in bug 1574475
99+
// Setting an FTPProxy should result in a warning but should not fail
100100
FTPProxy: "ftp.proxy.example.com:20",
101101
SSLProxy: "ssl.proxy.example.com:30",
102102
SOCKSProxy: "socks.proxy.example.com:40",
@@ -106,7 +106,18 @@ add_task(async function test_proxy_addresses() {
106106
});
107107

108108
checkProxyPref("http", "http.proxy.example.com", 10);
109-
checkProxyPref("ftp", "http.proxy.example.com", 10);
110109
checkProxyPref("ssl", "http.proxy.example.com", 10);
111110
checkProxyPref("socks", "http.proxy.example.com", 10);
111+
112+
// Make sure the FTPProxy setting did nothing
113+
Assert.equal(
114+
Preferences.has("network.proxy.ftp"),
115+
false,
116+
"network.proxy.ftp should not be set"
117+
);
118+
Assert.equal(
119+
Preferences.has("network.proxy.ftp_port"),
120+
false,
121+
"network.proxy.ftp_port should not be set"
122+
);
112123
});

browser/components/preferences/dialogs/connection.js

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ Preferences.addAll([
1919
{ id: "network.proxy.type", type: "int" },
2020
{ id: "network.proxy.http", type: "string" },
2121
{ id: "network.proxy.http_port", type: "int" },
22-
{ id: "network.proxy.ftp", type: "string" },
23-
{ id: "network.proxy.ftp_port", type: "int" },
2422
{ id: "network.proxy.ssl", type: "string" },
2523
{ id: "network.proxy.ssl_port", type: "int" },
2624
{ id: "network.proxy.socks", type: "string" },
@@ -31,8 +29,6 @@ Preferences.addAll([
3129
{ id: "network.proxy.share_proxy_settings", type: "bool" },
3230
{ id: "signon.autologin.proxy", type: "bool" },
3331
{ id: "pref.advanced.proxies.disable_button.reload", type: "bool" },
34-
{ id: "network.proxy.backup.ftp", type: "string" },
35-
{ id: "network.proxy.backup.ftp_port", type: "int" },
3632
{ id: "network.proxy.backup.ssl", type: "string" },
3733
{ id: "network.proxy.backup.ssl_port", type: "int" },
3834
{ id: "network.trr.mode", type: "int" },
@@ -137,7 +133,7 @@ var gConnectionsDialog = {
137133
);
138134

139135
// If the port is 0 and the proxy server is specified, focus on the port and cancel submission.
140-
for (let prefName of ["http", "ssl", "ftp", "socks"]) {
136+
for (let prefName of ["http", "ssl", "socks"]) {
141137
let proxyPortPref = Preferences.get(
142138
"network.proxy." + prefName + "_port"
143139
);
@@ -159,26 +155,15 @@ var gConnectionsDialog = {
159155

160156
// In the case of a shared proxy preference, backup the current values and update with the HTTP value
161157
if (shareProxiesPref.value) {
162-
var proxyPrefs = ["ssl", "ftp"];
163-
for (var i = 0; i < proxyPrefs.length; ++i) {
164-
var proxyServerURLPref = Preferences.get(
165-
"network.proxy." + proxyPrefs[i]
166-
);
167-
var proxyPortPref = Preferences.get(
168-
"network.proxy." + proxyPrefs[i] + "_port"
169-
);
170-
var backupServerURLPref = Preferences.get(
171-
"network.proxy.backup." + proxyPrefs[i]
172-
);
173-
var backupPortPref = Preferences.get(
174-
"network.proxy.backup." + proxyPrefs[i] + "_port"
175-
);
176-
backupServerURLPref.value =
177-
backupServerURLPref.value || proxyServerURLPref.value;
178-
backupPortPref.value = backupPortPref.value || proxyPortPref.value;
179-
proxyServerURLPref.value = httpProxyURLPref.value;
180-
proxyPortPref.value = httpProxyPortPref.value;
181-
}
158+
var proxyServerURLPref = Preferences.get("network.proxy.ssl");
159+
var proxyPortPref = Preferences.get("network.proxy.ssl_port");
160+
var backupServerURLPref = Preferences.get("network.proxy.backup.ssl");
161+
var backupPortPref = Preferences.get("network.proxy.backup.ssl_port");
162+
backupServerURLPref.value =
163+
backupServerURLPref.value || proxyServerURLPref.value;
164+
backupPortPref.value = backupPortPref.value || proxyPortPref.value;
165+
proxyServerURLPref.value = httpProxyURLPref.value;
166+
proxyPortPref.value = httpProxyPortPref.value;
182167
}
183168

184169
this.sanitizeNoProxiesPref();
@@ -266,7 +251,7 @@ var gConnectionsDialog = {
266251
var shareProxiesPref = Preferences.get(
267252
"network.proxy.share_proxy_settings"
268253
);
269-
var proxyPrefs = ["ssl", "ftp", "socks"];
254+
var proxyPrefs = ["ssl", "socks"];
270255
for (var i = 0; i < proxyPrefs.length; ++i) {
271256
var proxyServerURLPref = Preferences.get(
272257
"network.proxy." + proxyPrefs[i]
@@ -627,12 +612,6 @@ var gConnectionsDialog = {
627612
setSyncFromPrefListener("networkProxySSL_Port", () =>
628613
this.readProxyProtocolPref("ssl", true)
629614
);
630-
setSyncFromPrefListener("networkProxyFTP", () =>
631-
this.readProxyProtocolPref("ftp", false)
632-
);
633-
setSyncFromPrefListener("networkProxyFTP_Port", () =>
634-
this.readProxyProtocolPref("ftp", true)
635-
);
636615
setSyncFromPrefListener("networkProxySOCKS", () =>
637616
this.readProxyProtocolPref("socks", false)
638617
);

browser/components/preferences/dialogs/connection.xhtml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,6 @@
8282
preference="network.proxy.ssl_port"/>
8383
</hbox>
8484
</html:div>
85-
<html:div class="proxy-grid-row">
86-
<hbox pack="end">
87-
<label data-l10n-id="connection-proxy-ftp" control="networkProxyFTP"/>
88-
</hbox>
89-
<hbox align="center">
90-
<html:input id="networkProxyFTP" type="text" style="-moz-box-flex: 1;" preference="network.proxy.ftp"/>
91-
<label data-l10n-id="connection-proxy-ftp-port" control="networkProxyFTP_Port"/>
92-
<html:input id="networkProxyFTP_Port" class="proxy-port-input" hidespinbuttons="true" type="number" min="0" max="65535" size="5"
93-
preference="network.proxy.ftp_port"/>
94-
</hbox>
95-
</html:div>
9685
<separator class="thin"/>
9786
<html:div class="proxy-grid-row">
9887
<hbox pack="end">

browser/components/preferences/extensionControlled.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ const API_PROXY_PREFS = [
4444
"network.proxy.http",
4545
"network.proxy.http_port",
4646
"network.proxy.share_proxy_settings",
47-
"network.proxy.ftp",
48-
"network.proxy.ftp_port",
4947
"network.proxy.ssl",
5048
"network.proxy.ssl_port",
5149
"network.proxy.socks",

browser/components/preferences/main.inc.xhtml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,6 @@
708708
connection-proxy-option-manual.label,
709709
connection-proxy-http,
710710
connection-proxy-https,
711-
connection-proxy-ftp,
712711
connection-proxy-http-port,
713712
connection-proxy-socks,
714713
connection-proxy-socks4,

browser/components/preferences/tests/browser_connection_bug388287.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function test() {
1717
registerCleanupFunction(function() {
1818
Services.prefs.setIntPref("network.proxy.type", oldNetworkProxyType);
1919
Services.prefs.clearUserPref("network.proxy.share_proxy_settings");
20-
for (let proxyType of ["http", "ssl", "ftp", "socks"]) {
20+
for (let proxyType of ["http", "ssl", "socks"]) {
2121
Services.prefs.clearUserPref("network.proxy." + proxyType);
2222
Services.prefs.clearUserPref("network.proxy." + proxyType + "_port");
2323
if (proxyType == "http") {
@@ -37,7 +37,7 @@ function test() {
3737
*/
3838
open_preferences(async function tabOpened(aContentWindow) {
3939
let dialog, dialogClosingPromise, dialogElement;
40-
let proxyTypePref, sharePref, httpPref, httpPortPref, ftpPref, ftpPortPref;
40+
let proxyTypePref, sharePref, httpPref, httpPortPref;
4141

4242
// Convenient function to reset the variables for the new window
4343
async function setDoc() {
@@ -63,8 +63,6 @@ function test() {
6363
sharePref = dialog.Preferences.get("network.proxy.share_proxy_settings");
6464
httpPref = dialog.Preferences.get("network.proxy.http");
6565
httpPortPref = dialog.Preferences.get("network.proxy.http_port");
66-
ftpPref = dialog.Preferences.get("network.proxy.ftp");
67-
ftpPortPref = dialog.Preferences.get("network.proxy.ftp_port");
6866
}
6967

7068
// This batch of tests should not close the dialog
@@ -79,13 +77,10 @@ function test() {
7977

8078
// Testing HTTP port 0 + FTP port 80 with share off
8179
sharePref.value = false;
82-
ftpPref.value = "localhost";
83-
ftpPortPref.value = 80;
8480
dialogElement.acceptDialog();
8581

8682
// Testing HTTP port 80 + FTP port 0 with share off
8783
httpPortPref.value = 80;
88-
ftpPortPref.value = 0;
8984
dialogElement.acceptDialog();
9085

9186
// From now on, the dialog should close since we are giving it legitimate inputs.
@@ -94,17 +89,14 @@ function test() {
9489

9590
// Both ports 80, share on
9691
httpPortPref.value = 80;
97-
ftpPortPref.value = 80;
9892
dialogElement.acceptDialog();
9993

10094
// HTTP 80, FTP 0, with share on
10195
await setDoc();
10296
proxyTypePref.value = 1;
10397
sharePref.value = true;
104-
ftpPref.value = "localhost";
10598
httpPref.value = "localhost";
10699
httpPortPref.value = 80;
107-
ftpPortPref.value = 0;
108100
dialogElement.acceptDialog();
109101

110102
// HTTP host empty, port 0 with share on

browser/components/preferences/tests/browser_proxy_backup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function test() {
1515
Services.prefs.setIntPref("network.proxy.type", oldNetworkProxyType);
1616
Services.prefs.clearUserPref("browser.preferences.instantApply");
1717
Services.prefs.clearUserPref("network.proxy.share_proxy_settings");
18-
for (let proxyType of ["http", "ssl", "ftp", "socks"]) {
18+
for (let proxyType of ["http", "ssl", "socks"]) {
1919
Services.prefs.clearUserPref("network.proxy." + proxyType);
2020
Services.prefs.clearUserPref("network.proxy." + proxyType + "_port");
2121
if (proxyType == "http") {

browser/locales/en-US/browser/preferences/connection.ftl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ connection-proxy-https = HTTPS Proxy
4444
connection-proxy-ssl-port = Port
4545
.accesskey = o
4646
47-
connection-proxy-ftp = FTP Proxy
48-
.accesskey = F
49-
connection-proxy-ftp-port = Port
50-
.accesskey = r
51-
5247
connection-proxy-socks = SOCKS Host
5348
.accesskey = C
5449
connection-proxy-socks-port = Port

netwerk/base/nsIProtocolHandler.idl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ interface nsIProtocolHandler : nsISupports
107107

108108
/**
109109
* standard full URI with authority component and concept of relative
110-
* URIs (http, ftp, ...)
110+
* URIs (http, ...)
111111
*/
112112
const unsigned long URI_STD = 0;
113113

@@ -136,7 +136,7 @@ interface nsIProtocolHandler : nsISupports
136136

137137
/**
138138
* This protocol handler can be proxied using a http proxy (e.g., http,
139-
* ftp, etc.). nsIIOService::newChannelFromURI will feed URIs from this
139+
* etc.). nsIIOService::newChannelFromURI will feed URIs from this
140140
* protocol handler to the HTTP protocol handler instead. This flag is
141141
* ignored if ALLOWS_PROXY is not set.
142142
*/

0 commit comments

Comments
 (0)