mirror of
https://github.com/ducaale/xh.git
synced 2025-05-05 15:32:50 +00:00
hyper v1 upgrade
This commit is contained in:
parent
7a8822b1c8
commit
3f658ed4ed
262
Cargo.lock
generated
262
Cargo.lock
generated
@ -137,6 +137,12 @@ version = "0.21.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
|
||||
|
||||
[[package]]
|
||||
name = "base64"
|
||||
version = "0.22.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51"
|
||||
|
||||
[[package]]
|
||||
name = "bincode"
|
||||
version = "1.3.3"
|
||||
@ -306,17 +312,6 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cookie"
|
||||
version = "0.16.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e859cd57d0710d9e06c381b550c06e76992472a8c6d527aecd2fc673dcc231fb"
|
||||
dependencies = [
|
||||
"percent-encoding",
|
||||
"time",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cookie"
|
||||
version = "0.17.0"
|
||||
@ -328,30 +323,13 @@ dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cookie_store"
|
||||
version = "0.16.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d606d0fba62e13cf04db20536c05cb7f13673c161cb47a47a82b9b9e7d3f1daa"
|
||||
dependencies = [
|
||||
"cookie 0.16.2",
|
||||
"idna 0.2.3",
|
||||
"log",
|
||||
"publicsuffix",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"time",
|
||||
"url",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cookie_store"
|
||||
version = "0.20.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6"
|
||||
dependencies = [
|
||||
"cookie 0.17.0",
|
||||
"cookie",
|
||||
"idna 0.3.0",
|
||||
"indexmap 1.9.3",
|
||||
"log",
|
||||
@ -580,6 +558,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-sink",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -614,6 +593,7 @@ checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-io",
|
||||
"futures-sink",
|
||||
"futures-task",
|
||||
"memchr",
|
||||
"pin-project-lite",
|
||||
@ -659,9 +639,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
|
||||
|
||||
[[package]]
|
||||
name = "h2"
|
||||
version = "0.3.24"
|
||||
version = "0.4.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9"
|
||||
checksum = "51ee2dd2e4f378392eeff5d51618cd9a63166a2513846bbc55f21cfacd9199d4"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"fnv",
|
||||
@ -708,9 +688,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
|
||||
|
||||
[[package]]
|
||||
name = "http"
|
||||
version = "0.2.11"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb"
|
||||
checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"fnv",
|
||||
@ -719,12 +699,24 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "http-body"
|
||||
version = "0.4.6"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2"
|
||||
checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "http-body-util"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-core",
|
||||
"http",
|
||||
"http-body",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
@ -742,13 +734,12 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
||||
|
||||
[[package]]
|
||||
name = "hyper"
|
||||
version = "0.14.28"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"
|
||||
checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"h2",
|
||||
"http",
|
||||
@ -757,49 +748,62 @@ dependencies = [
|
||||
"httpdate",
|
||||
"itoa",
|
||||
"pin-project-lite",
|
||||
"socket2",
|
||||
"smallvec",
|
||||
"tokio",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
"want",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-rustls"
|
||||
version = "0.24.2"
|
||||
version = "0.26.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
|
||||
checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c"
|
||||
dependencies = [
|
||||
"futures-util",
|
||||
"http",
|
||||
"hyper",
|
||||
"hyper-util",
|
||||
"rustls",
|
||||
"rustls-pki-types",
|
||||
"tokio",
|
||||
"tokio-rustls",
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hyper-tls"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
|
||||
checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http-body-util",
|
||||
"hyper",
|
||||
"hyper-util",
|
||||
"native-tls",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
"tower-service",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "idna"
|
||||
version = "0.2.3"
|
||||
name = "hyper-util"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
|
||||
checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa"
|
||||
dependencies = [
|
||||
"matches",
|
||||
"unicode-bidi",
|
||||
"unicode-normalization",
|
||||
"bytes",
|
||||
"futures-channel",
|
||||
"futures-util",
|
||||
"http",
|
||||
"http-body",
|
||||
"hyper",
|
||||
"pin-project-lite",
|
||||
"socket2",
|
||||
"tokio",
|
||||
"tower",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -951,12 +955,6 @@ version = "0.4.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
|
||||
|
||||
[[package]]
|
||||
name = "matches"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
|
||||
|
||||
[[package]]
|
||||
name = "md-5"
|
||||
version = "0.10.6"
|
||||
@ -1178,7 +1176,7 @@ version = "3.0.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"base64 0.21.7",
|
||||
"serde",
|
||||
]
|
||||
|
||||
@ -1188,6 +1186,26 @@ version = "2.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
|
||||
|
||||
[[package]]
|
||||
name = "pin-project"
|
||||
version = "1.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3"
|
||||
dependencies = [
|
||||
"pin-project-internal",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-internal"
|
||||
version = "1.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.13"
|
||||
@ -1212,7 +1230,7 @@ version = "1.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"base64 0.21.7",
|
||||
"indexmap 2.2.0",
|
||||
"line-wrap",
|
||||
"quick-xml",
|
||||
@ -1404,23 +1422,25 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
||||
|
||||
[[package]]
|
||||
name = "reqwest"
|
||||
version = "0.11.23"
|
||||
version = "0.12.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41"
|
||||
checksum = "3e6cc1e89e689536eb5aeede61520e874df5a4707df811cd5da4aa5fbb2aae19"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"base64 0.22.0",
|
||||
"bytes",
|
||||
"cookie 0.16.2",
|
||||
"cookie_store 0.16.2",
|
||||
"encoding_rs",
|
||||
"cookie",
|
||||
"cookie_store",
|
||||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"h2",
|
||||
"http",
|
||||
"http-body",
|
||||
"http-body-util",
|
||||
"hyper",
|
||||
"hyper-rustls",
|
||||
"hyper-tls",
|
||||
"hyper-util",
|
||||
"ipnet",
|
||||
"js-sys",
|
||||
"log",
|
||||
@ -1433,9 +1453,11 @@ dependencies = [
|
||||
"rustls",
|
||||
"rustls-native-certs",
|
||||
"rustls-pemfile",
|
||||
"rustls-pki-types",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_urlencoded",
|
||||
"sync_wrapper",
|
||||
"system-configuration",
|
||||
"tokio",
|
||||
"tokio-native-tls",
|
||||
@ -1512,44 +1534,55 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.21.10"
|
||||
version = "0.22.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba"
|
||||
checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41"
|
||||
dependencies = [
|
||||
"log",
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki",
|
||||
"sct",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-native-certs"
|
||||
version = "0.6.3"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00"
|
||||
checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792"
|
||||
dependencies = [
|
||||
"openssl-probe",
|
||||
"rustls-pemfile",
|
||||
"rustls-pki-types",
|
||||
"schannel",
|
||||
"security-framework",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-pemfile"
|
||||
version = "1.0.4"
|
||||
version = "2.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c"
|
||||
checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"base64 0.21.7",
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.101.7"
|
||||
name = "rustls-pki-types"
|
||||
version = "1.3.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765"
|
||||
checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8"
|
||||
|
||||
[[package]]
|
||||
name = "rustls-webpki"
|
||||
version = "0.102.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
@ -1583,16 +1616,6 @@ dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sct"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414"
|
||||
dependencies = [
|
||||
"ring",
|
||||
"untrusted",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "security-framework"
|
||||
version = "2.9.2"
|
||||
@ -1680,6 +1703,12 @@ dependencies = [
|
||||
"autocfg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.13.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
|
||||
|
||||
[[package]]
|
||||
name = "socket2"
|
||||
version = "0.5.5"
|
||||
@ -1702,6 +1731,12 @@ version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
||||
|
||||
[[package]]
|
||||
name = "subtle"
|
||||
version = "2.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "2.0.48"
|
||||
@ -1713,6 +1748,12 @@ dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sync_wrapper"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160"
|
||||
|
||||
[[package]]
|
||||
name = "syntect"
|
||||
version = "5.1.0"
|
||||
@ -1885,11 +1926,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tokio-rustls"
|
||||
version = "0.24.1"
|
||||
version = "0.25.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
|
||||
checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f"
|
||||
dependencies = [
|
||||
"rustls",
|
||||
"rustls-pki-types",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
@ -1919,6 +1961,28 @@ dependencies = [
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tower"
|
||||
version = "0.4.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"pin-project",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tower-layer"
|
||||
version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
|
||||
|
||||
[[package]]
|
||||
name = "tower-service"
|
||||
version = "0.3.2"
|
||||
@ -1931,6 +1995,7 @@ version = "0.1.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef"
|
||||
dependencies = [
|
||||
"log",
|
||||
"pin-project-lite",
|
||||
"tracing-core",
|
||||
]
|
||||
@ -2139,9 +2204,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "webpki-roots"
|
||||
version = "0.25.3"
|
||||
version = "0.26.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10"
|
||||
checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009"
|
||||
dependencies = [
|
||||
"rustls-pki-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
@ -2308,9 +2376,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04"
|
||||
|
||||
[[package]]
|
||||
name = "winreg"
|
||||
version = "0.50.0"
|
||||
version = "0.52.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1"
|
||||
checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"windows-sys 0.48.0",
|
||||
@ -2326,14 +2394,16 @@ dependencies = [
|
||||
"chardetng",
|
||||
"clap",
|
||||
"clap_complete",
|
||||
"cookie_store 0.20.0",
|
||||
"cookie_store",
|
||||
"digest_auth",
|
||||
"dirs",
|
||||
"encoding_rs",
|
||||
"encoding_rs_io",
|
||||
"flate2",
|
||||
"form_urlencoded",
|
||||
"http-body-util",
|
||||
"hyper",
|
||||
"hyper-util",
|
||||
"indicatif",
|
||||
"indoc",
|
||||
"jsonxf",
|
||||
@ -2371,3 +2441,9 @@ checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
|
||||
dependencies = [
|
||||
"linked-hash-map",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zeroize"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d"
|
||||
|
@ -48,9 +48,9 @@ unicode-width = "0.1.9"
|
||||
url = "2.2.2"
|
||||
|
||||
[dependencies.reqwest]
|
||||
version = "0.11.18"
|
||||
version = "0.12.3"
|
||||
default-features = false
|
||||
features = ["json", "multipart", "blocking", "socks", "cookies"]
|
||||
features = ["json", "multipart", "blocking", "socks", "cookies", "http2", "macos-system-configuration"]
|
||||
|
||||
[dependencies.syntect]
|
||||
version = "5.1"
|
||||
@ -68,9 +68,11 @@ form_urlencoded = "1.0.1"
|
||||
indoc = "2.0"
|
||||
rand = "0.8.3"
|
||||
predicates = "3.0"
|
||||
hyper = { version = "0.14", features = ["server"] }
|
||||
hyper = { version = "1.2", features = ["server"] }
|
||||
tokio = { version = "1", features = ["rt", "sync", "time"] }
|
||||
tempfile = "3.2.0"
|
||||
hyper-util = { version = "0.1.3", features = ["server"] }
|
||||
http-body-util = "0.1.1"
|
||||
|
||||
[features]
|
||||
# Ideally network-interface would be disabled by default on certain platforms
|
||||
|
28
tests/cli.rs
28
tests/cli.rs
@ -13,6 +13,7 @@ use std::str::FromStr;
|
||||
use std::time::{Duration, SystemTime, UNIX_EPOCH};
|
||||
|
||||
use assert_cmd::cmd::Command;
|
||||
use http_body_util::BodyExt;
|
||||
use indoc::indoc;
|
||||
use predicates::function::function;
|
||||
use predicates::str::contains;
|
||||
@ -26,7 +27,7 @@ pub trait RequestExt {
|
||||
|
||||
impl<T> RequestExt for hyper::Request<T>
|
||||
where
|
||||
T: hyper::body::HttpBody + Send + 'static,
|
||||
T: hyper::body::Body + Send + 'static,
|
||||
T::Data: Send,
|
||||
T::Error: std::fmt::Debug,
|
||||
{
|
||||
@ -37,13 +38,7 @@ where
|
||||
}
|
||||
|
||||
fn body(self) -> Pin<Box<dyn Future<Output = Vec<u8>> + Send>> {
|
||||
let fut = async {
|
||||
hyper::body::to_bytes(self)
|
||||
.await
|
||||
.unwrap()
|
||||
.as_ref()
|
||||
.to_owned()
|
||||
};
|
||||
let fut = async { self.collect().await.unwrap().to_bytes().to_vec() };
|
||||
Box::pin(fut)
|
||||
}
|
||||
|
||||
@ -210,6 +205,21 @@ fn multiline_value() {
|
||||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn post_empty_body() {
|
||||
let server = server::http(|req| async move {
|
||||
assert_eq!(req.method(), "POST");
|
||||
assert_eq!(req.headers().get(reqwest::header::TRANSFER_ENCODING), None);
|
||||
assert_eq!(req.body_as_string().await, "");
|
||||
hyper::Response::default()
|
||||
});
|
||||
|
||||
get_command()
|
||||
.args(["post", &server.base_url()])
|
||||
.assert()
|
||||
.success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn nested_json() {
|
||||
let server = server::http(|req| async move {
|
||||
@ -3071,7 +3081,7 @@ fn http2_prior_knowledge() {
|
||||
.arg(server.base_url())
|
||||
.assert()
|
||||
.failure()
|
||||
.stderr(contains("unsupported HTTP version"));
|
||||
.stderr(contains("UserUnsupportedVersion"));
|
||||
|
||||
get_command()
|
||||
.arg("-v")
|
||||
|
@ -1,18 +1,26 @@
|
||||
// Copied from https://github.com/seanmonstar/reqwest/blob/ab49de875ec2326abf25f52f54b249a28e43b69c/tests/support/server.rs
|
||||
// Copied from https://raw.githubusercontent.com/seanmonstar/reqwest/v0.12.0/tests/support/server.rs
|
||||
// with some slight tweaks
|
||||
use std::convert::Infallible;
|
||||
use std::future::Future;
|
||||
use std::net;
|
||||
use std::sync::mpsc as std_mpsc;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
|
||||
use hyper::service::{make_service_fn, service_fn};
|
||||
use hyper::{Body, Request, Response};
|
||||
use http_body_util::Full;
|
||||
use hyper::body::Bytes;
|
||||
use hyper::service::service_fn;
|
||||
use hyper::{Request, Response};
|
||||
use tokio::runtime;
|
||||
use tokio::sync::oneshot;
|
||||
|
||||
type Body = Full<Bytes>;
|
||||
type Builder = hyper_util::server::conn::auto::Builder<hyper_util::rt::TokioExecutor>;
|
||||
|
||||
pub struct Server {
|
||||
addr: net::SocketAddr,
|
||||
panic_rx: std_mpsc::Receiver<()>,
|
||||
successful_hits: Arc<Mutex<u8>>,
|
||||
total_hits: Arc<Mutex<u8>>,
|
||||
no_hit_checks: bool,
|
||||
@ -51,17 +59,23 @@ impl Drop for Server {
|
||||
let _ = tx.send(());
|
||||
}
|
||||
|
||||
if !::std::thread::panicking() && !self.no_hit_checks {
|
||||
if !std::thread::panicking() && !self.no_hit_checks {
|
||||
let total_hits = *self.total_hits.lock().unwrap();
|
||||
let successful_hits = *self.successful_hits.lock().unwrap();
|
||||
let failed_hits = total_hits - successful_hits;
|
||||
assert!(total_hits > 0, "test server exited without being called");
|
||||
assert!(
|
||||
failed_hits == 0,
|
||||
assert_eq!(
|
||||
failed_hits, 0,
|
||||
"numbers of panicked or in-progress requests: {}",
|
||||
failed_hits
|
||||
);
|
||||
}
|
||||
|
||||
if !std::thread::panicking() {
|
||||
self.panic_rx
|
||||
.recv_timeout(Duration::from_secs(3))
|
||||
.expect("test server should not panic");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,72 +86,88 @@ impl Drop for Server {
|
||||
|
||||
pub fn http<F, Fut>(func: F) -> Server
|
||||
where
|
||||
F: Fn(Request<Body>) -> Fut + Send + Sync + 'static,
|
||||
F: Fn(Request<hyper::body::Incoming>) -> Fut + Send + Sync + 'static,
|
||||
Fut: Future<Output = Response<Body>> + Send + 'static,
|
||||
{
|
||||
http_inner(Arc::new(move |req| Box::new(Box::pin(func(req)))))
|
||||
}
|
||||
|
||||
type Serv = dyn Fn(Request<Body>) -> Box<ServFut> + Send + Sync;
|
||||
type Serv = dyn Fn(Request<hyper::body::Incoming>) -> Box<ServFut> + Send + Sync;
|
||||
type ServFut = dyn Future<Output = Response<Body>> + Send + Unpin;
|
||||
|
||||
fn http_inner(func: Arc<Serv>) -> Server {
|
||||
//Spawn new runtime in thread to prevent reactor execution context conflict
|
||||
// Spawn new runtime in thread to prevent reactor execution context conflict
|
||||
thread::spawn(move || {
|
||||
let successful_hits = Arc::new(Mutex::new(0));
|
||||
let total_hits = Arc::new(Mutex::new(0));
|
||||
let rt = runtime::Builder::new_current_thread()
|
||||
.enable_all()
|
||||
.build()
|
||||
.expect("new rt");
|
||||
let srv = {
|
||||
let successful_hits = Arc::new(Mutex::new(0));
|
||||
let total_hits = Arc::new(Mutex::new(0));
|
||||
let listener = rt.block_on(async move {
|
||||
tokio::net::TcpListener::bind(&std::net::SocketAddr::from(([127, 0, 0, 1], 0)))
|
||||
.await
|
||||
.unwrap()
|
||||
});
|
||||
let addr = listener.local_addr().unwrap();
|
||||
|
||||
let (shutdown_tx, shutdown_rx) = oneshot::channel();
|
||||
let (panic_tx, panic_rx) = std_mpsc::channel();
|
||||
let thread_name = format!(
|
||||
"test({})-support-server",
|
||||
thread::current().name().unwrap_or("<unknown>")
|
||||
);
|
||||
|
||||
{
|
||||
let successful_hits = successful_hits.clone();
|
||||
let total_hits = total_hits.clone();
|
||||
#[allow(clippy::async_yields_async)]
|
||||
rt.block_on(async move {
|
||||
let make_service = make_service_fn(move |_| {
|
||||
let func = func.clone();
|
||||
let successful_hits = successful_hits.clone();
|
||||
let total_hits = total_hits.clone();
|
||||
async move {
|
||||
Ok::<_, Infallible>(service_fn(move |req| {
|
||||
let fut = func(req);
|
||||
let successful_hits = successful_hits.clone();
|
||||
let total_hits = total_hits.clone();
|
||||
async move {
|
||||
*total_hits.lock().unwrap() += 1;
|
||||
let res = fut.await;
|
||||
*successful_hits.lock().unwrap() += 1;
|
||||
Ok::<_, Infallible>(res)
|
||||
}
|
||||
}))
|
||||
}
|
||||
});
|
||||
// Port 0 is used to obtain a dynamically assigned port.
|
||||
// See https://networkengineering.stackexchange.com/a/64784
|
||||
hyper::Server::bind(&([127, 0, 0, 1], 0).into()).serve(make_service)
|
||||
})
|
||||
};
|
||||
thread::Builder::new()
|
||||
.name(thread_name)
|
||||
.spawn(move || {
|
||||
let task = rt.spawn(async move {
|
||||
let builder = Builder::new(hyper_util::rt::TokioExecutor::new());
|
||||
loop {
|
||||
let svc = {
|
||||
let func = func.clone();
|
||||
let successful_hits = successful_hits.clone();
|
||||
let total_hits = total_hits.clone();
|
||||
|
||||
let addr = srv.local_addr();
|
||||
let (shutdown_tx, shutdown_rx) = oneshot::channel();
|
||||
let srv = srv.with_graceful_shutdown(async move {
|
||||
let _ = shutdown_rx.await;
|
||||
});
|
||||
service_fn(move |req| {
|
||||
let successful_hits = successful_hits.clone();
|
||||
let total_hits = total_hits.clone();
|
||||
let fut = func(req);
|
||||
async move {
|
||||
*total_hits.lock().unwrap() += 1;
|
||||
let res = fut.await;
|
||||
*successful_hits.lock().unwrap() += 1;
|
||||
Ok::<_, Infallible>(res)
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
thread::Builder::new()
|
||||
.name("test-server".into())
|
||||
.spawn(move || {
|
||||
rt.block_on(srv).unwrap();
|
||||
})
|
||||
.expect("thread spawn");
|
||||
let (io, _) = listener.accept().await.unwrap();
|
||||
|
||||
let builder = builder.clone();
|
||||
tokio::spawn(async move {
|
||||
let _ = builder
|
||||
.serve_connection(hyper_util::rt::TokioIo::new(io), svc)
|
||||
.await;
|
||||
});
|
||||
}
|
||||
});
|
||||
let _ = rt.block_on(shutdown_rx);
|
||||
task.abort();
|
||||
let _ = panic_tx.send(());
|
||||
})
|
||||
.expect("thread spawn");
|
||||
}
|
||||
Server {
|
||||
addr,
|
||||
panic_rx,
|
||||
shutdown_tx: Some(shutdown_tx),
|
||||
successful_hits,
|
||||
total_hits,
|
||||
no_hit_checks: false,
|
||||
shutdown_tx: Some(shutdown_tx),
|
||||
}
|
||||
})
|
||||
.join()
|
||||
|
Loading…
x
Reference in New Issue
Block a user