Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions dotnet/src/webdriver/Proxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public class Proxy
{
private ProxyKind proxyKind = ProxyKind.Unspecified;
private bool isAutoDetect;
private string? ftpProxyLocation;
private string? httpProxyLocation;
private string? proxyAutoConfigUrl;
private string? sslProxyLocation;
Expand Down Expand Up @@ -116,11 +115,6 @@ public Proxy(Dictionary<string, object> settings)
}
}

if (settings.TryGetValue("ftpProxy", out object? ftpProxyObj) && ftpProxyObj?.ToString() is string ftpProxy)
{
this.FtpProxy = ftpProxy;
}

if (settings.TryGetValue("httpProxy", out object? httpProxyObj) && httpProxyObj?.ToString() is string httpProxy)
{
this.HttpProxy = httpProxy;
Expand Down Expand Up @@ -236,24 +230,6 @@ public bool IsAutoDetect
}
}

/// <summary>
/// Gets or sets the value of the proxy for the FTP protocol.
/// </summary>
[JsonPropertyName("ftpProxy")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
[Obsolete("FTP proxy support is deprecated and will be removed in the 4.37 version.")]
public string? FtpProxy
{
get => this.ftpProxyLocation;

set
{
this.VerifyProxyTypeCompatilibily(ProxyKind.Manual);
this.proxyKind = ProxyKind.Manual;
this.ftpProxyLocation = value;
}
}

/// <summary>
/// Gets or sets the value of the proxy for the HTTP protocol.
/// </summary>
Expand Down Expand Up @@ -494,11 +470,6 @@ public void AddBypassAddresses(IEnumerable<string> addressesToAdd)
serializedDictionary["sslProxy"] = this.sslProxyLocation;
}

if (!string.IsNullOrEmpty(this.ftpProxyLocation))
{
serializedDictionary["ftpProxy"] = this.ftpProxyLocation;
}

if (!string.IsNullOrEmpty(this.socksProxyLocation))
{
if (!this.socksVersion.HasValue)
Expand Down
13 changes: 0 additions & 13 deletions dotnet/test/common/ProxyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ public void NotInitializedProxy()
Proxy proxy = new Proxy();

Assert.That(proxy.Kind, Is.EqualTo(ProxyKind.Unspecified));
Assert.That(proxy.FtpProxy, Is.Null);
Assert.That(proxy.HttpProxy, Is.Null);
Assert.That(proxy.SslProxy, Is.Null);
Assert.That(proxy.SocksProxy, Is.Null);
Expand All @@ -54,7 +53,6 @@ public void CanNotChangeAlreadyInitializedProxyType()
Assert.That(() => proxy.SocksUserName = "", Throws.InvalidOperationException);
Assert.That(() => proxy.SocksProxy = "", Throws.InvalidOperationException);
Assert.That(() => proxy.SocksVersion = 5, Throws.InvalidOperationException);
Assert.That(() => proxy.FtpProxy = "", Throws.InvalidOperationException);
Assert.That(() => proxy.HttpProxy = "", Throws.InvalidOperationException);
Assert.That(() => proxy.SslProxy = "", Throws.InvalidOperationException);
Assert.That(() => proxy.ProxyAutoConfigUrl = "", Throws.InvalidOperationException);
Expand All @@ -73,7 +71,6 @@ public void ManualProxy()
Proxy proxy = new Proxy();

proxy.HttpProxy = "http.proxy:1234";
proxy.FtpProxy = "ftp.proxy";
proxy.SslProxy = "ssl.proxy";
proxy.AddBypassAddresses("localhost", "127.0.0.*");
proxy.SocksProxy = "socks.proxy:65555";
Expand All @@ -82,7 +79,6 @@ public void ManualProxy()
proxy.SocksPassword = "test2";

Assert.That(proxy.Kind, Is.EqualTo(ProxyKind.Manual));
Assert.That(proxy.FtpProxy, Is.EqualTo("ftp.proxy"));
Assert.That(proxy.HttpProxy, Is.EqualTo("http.proxy:1234"));
Assert.That(proxy.SslProxy, Is.EqualTo("ssl.proxy"));
Assert.That(proxy.SocksProxy, Is.EqualTo("socks.proxy:65555"));
Expand All @@ -104,7 +100,6 @@ public void PACProxy()
Assert.That(proxy.Kind, Is.EqualTo(ProxyKind.ProxyAutoConfigure));
Assert.That(proxy.ProxyAutoConfigUrl, Is.EqualTo("http://aaa/bbb.pac"));

Assert.That(proxy.FtpProxy, Is.Null);
Assert.That(proxy.HttpProxy, Is.Null);
Assert.That(proxy.SslProxy, Is.Null);
Assert.That(proxy.SocksProxy, Is.Null);
Expand All @@ -124,7 +119,6 @@ public void AutoDetectProxy()
Assert.That(proxy.Kind, Is.EqualTo(ProxyKind.AutoDetect));
Assert.That(proxy.IsAutoDetect, Is.True);

Assert.That(proxy.FtpProxy, Is.Null);
Assert.That(proxy.HttpProxy, Is.Null);
Assert.That(proxy.SslProxy, Is.Null);
Assert.That(proxy.SocksProxy, Is.Null);
Expand Down Expand Up @@ -153,7 +147,6 @@ public void ManualProxyFromDictionary()
Proxy proxy = new Proxy(proxyData);

Assert.That(proxy.Kind, Is.EqualTo(ProxyKind.Manual));
Assert.That(proxy.FtpProxy, Is.EqualTo("ftp.proxy"));
Assert.That(proxy.HttpProxy, Is.EqualTo("http.proxy:1234"));
Assert.That(proxy.SslProxy, Is.EqualTo("ssl.proxy"));
Assert.That(proxy.SocksProxy, Is.EqualTo("socks.proxy:65555"));
Expand Down Expand Up @@ -199,7 +192,6 @@ public void PacProxyFromDictionary()
Assert.That(proxy.Kind, Is.EqualTo(ProxyKind.ProxyAutoConfigure));
Assert.That(proxy.ProxyAutoConfigUrl, Is.EqualTo("http://aaa/bbb.pac"));

Assert.That(proxy.FtpProxy, Is.Null);
Assert.That(proxy.HttpProxy, Is.Null);
Assert.That(proxy.SslProxy, Is.Null);
Assert.That(proxy.SocksProxy, Is.Null);
Expand All @@ -222,7 +214,6 @@ public void AutoDetectProxyFromDictionary()
Assert.That(proxy.Kind, Is.EqualTo(ProxyKind.AutoDetect));
Assert.That(proxy.IsAutoDetect, Is.True);

Assert.That(proxy.FtpProxy, Is.Null);
Assert.That(proxy.HttpProxy, Is.Null);
Assert.That(proxy.SslProxy, Is.Null);
Assert.That(proxy.SocksProxy, Is.Null);
Expand All @@ -243,7 +234,6 @@ public void SystemProxyFromDictionary()

Assert.That(proxy.Kind, Is.EqualTo(ProxyKind.System));

Assert.That(proxy.FtpProxy, Is.Null);
Assert.That(proxy.HttpProxy, Is.Null);
Assert.That(proxy.SslProxy, Is.Null);
Assert.That(proxy.SocksProxy, Is.Null);
Expand All @@ -265,7 +255,6 @@ public void DirectProxyFromDictionary()

Assert.That(proxy.Kind, Is.EqualTo(ProxyKind.Direct));

Assert.That(proxy.FtpProxy, Is.Null);
Assert.That(proxy.HttpProxy, Is.Null);
Assert.That(proxy.SslProxy, Is.Null);
Assert.That(proxy.SocksProxy, Is.Null);
Expand All @@ -281,13 +270,11 @@ public void DirectProxyFromDictionary()
public void ConstructingWithNullKeysWorksAsExpected()
{
Dictionary<string, object> rawProxy = new Dictionary<string, object>();
rawProxy.Add("ftpProxy", null);
rawProxy.Add("httpProxy", "http://www.example.com");
rawProxy.Add("autodetect", null);

Proxy proxy = new Proxy(rawProxy);

Assert.That(proxy.FtpProxy, Is.Null);
Assert.That(proxy.IsAutoDetect, Is.False);
Assert.That(proxy.HttpProxy, Is.EqualTo("http://www.example.com"));
}
Expand Down