Update url crate to 2.1

This commit is contained in:
johannesd3 2021-02-22 11:26:12 +01:00 committed by Johannesd3
parent b606d8c661
commit f22b41956f
6 changed files with 19 additions and 47 deletions

54
Cargo.lock generated
View file

@ -336,7 +336,7 @@ version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "784ad0fbab4f3e9cef09f20e0aea6000ae08d2cb98ac4c0abc53df18803d702f"
dependencies = [
"percent-encoding 2.1.0",
"percent-encoding",
"time 0.2.25",
"version_check",
]
@ -348,13 +348,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3818dfca4b0cb5211a659bbcbb94225b7127407b2b135e650d717bfb78ab10d3"
dependencies = [
"cookie",
"idna 0.2.2",
"idna",
"log",
"publicsuffix",
"serde",
"serde_json",
"time 0.2.25",
"url 2.2.1",
"url",
]
[[package]]
@ -578,7 +578,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191"
dependencies = [
"matches",
"percent-encoding 2.1.0",
"percent-encoding",
]
[[package]]
@ -990,17 +990,6 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "idna"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
dependencies = [
"matches",
"unicode-bidi",
"unicode-normalization",
]
[[package]]
name = "idna"
version = "0.2.2"
@ -1286,7 +1275,7 @@ dependencies = [
"rpassword",
"sha-1",
"tokio",
"url 1.7.2",
"url",
]
[[package]]
@ -1333,7 +1322,7 @@ dependencies = [
"sha-1",
"tokio",
"tokio-stream",
"url 1.7.2",
"url",
]
[[package]]
@ -1368,7 +1357,7 @@ dependencies = [
"tokio",
"tokio-stream",
"tokio-util",
"url 1.7.2",
"url",
"vergen",
]
@ -1797,12 +1786,6 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
[[package]]
name = "percent-encoding"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
[[package]]
name = "percent-encoding"
version = "2.1.0"
@ -1975,10 +1958,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b"
dependencies = [
"error-chain",
"idna 0.2.2",
"idna",
"lazy_static",
"regex",
"url 2.2.1",
"url",
]
[[package]]
@ -1987,7 +1970,7 @@ version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e"
dependencies = [
"percent-encoding 2.1.0",
"percent-encoding",
]
[[package]]
@ -2801,22 +2784,11 @@ dependencies = [
"once_cell",
"qstring",
"rustls",
"url 2.2.1",
"url",
"webpki",
"webpki-roots",
]
[[package]]
name = "url"
version = "1.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a"
dependencies = [
"idna 0.1.5",
"matches",
"percent-encoding 1.0.1",
]
[[package]]
name = "url"
version = "2.2.1"
@ -2824,9 +2796,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b"
dependencies = [
"form_urlencoded",
"idna 0.2.2",
"idna",
"matches",
"percent-encoding 2.1.0",
"percent-encoding",
]
[[package]]

View file

@ -54,7 +54,7 @@ hyper = "0.14"
log = "0.4"
rpassword = "5.0"
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "signal", "sync", "process"] }
url = "1.7"
url = "2.1"
sha-1 = "0.9"
[features]

View file

@ -24,7 +24,7 @@ serde_json = "1.0"
sha-1 = "0.9"
tokio = { version = "1.0", features = ["macros", "rt", "sync"] }
tokio-stream = { version = "0.1" }
url = "1.7"
url = "2.1"
dns-sd = { version = "0.1.3", optional = true }
libmdns = { version = "0.6", optional = true }

View file

@ -39,7 +39,7 @@ thiserror = "1"
tokio = { version = "1.0", features = ["io-util", "net", "rt", "sync"] }
tokio-stream = "0.1"
tokio-util = { version = "0.6", features = ["codec"] }
url = "1.7"
url = "2.1"
[build-dependencies]
rand = "0.8"

View file

@ -32,7 +32,7 @@ cfg_if! {
let response = if let Some(url) = proxy {
Client::builder()
.build(ProxyTunnel::new(url)?)
.build(ProxyTunnel::new(&url.socket_addrs(|| None)?[..])?)
.request(req)
.await?
} else {

View file

@ -76,8 +76,8 @@ pub async fn connect(addr: String, proxy: &Option<Url>) -> io::Result<Transport>
.next()
.ok_or_else(|| io::Error::new(io::ErrorKind::InvalidInput, "Missing port"))?;
let socket_addr = proxy.to_socket_addrs().and_then(|mut iter| {
iter.next().ok_or_else(|| {
let socket_addr = proxy.socket_addrs(|| None).and_then(|addrs| {
addrs.into_iter().next().ok_or_else(|| {
io::Error::new(
io::ErrorKind::NotFound,
"Can't resolve proxy server address",