From 53c59aac9471a088c52fd379cf59d40233aab32b Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Mon, 4 Dec 2023 14:41:33 -0800 Subject: [PATCH 01/25] Update to rustls 0.22 (#690) --- Cargo.lock | 172 ++++++++++++++++------------------------- Cargo.toml | 13 ++-- examples/cureq/main.rs | 40 +++++++--- examples/tls_config.rs | 14 +--- src/agent.rs | 12 +-- src/rtls.rs | 42 +++------- tests/https-agent.rs | 37 +++------ 7 files changed, 130 insertions(+), 200 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index af5aedb2..a708ff82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -66,12 +66,6 @@ dependencies = [ "alloc-stdlib", ] -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - [[package]] name = "byteorder" version = "1.4.3" @@ -247,6 +241,17 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "getrandom" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -324,15 +329,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" -[[package]] -name = "js-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" -dependencies = [ - "wasm-bindgen", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -341,9 +337,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "linux-raw-sys" @@ -510,17 +506,16 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "ring" -version = "0.16.20" +version = "0.17.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys", ] [[package]] @@ -538,14 +533,16 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "5bc238b76c51bbc449c55ffbc39d03772a057cc8cf783c49d4af4c2537b74a8b" dependencies = [ "log", "ring", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] [[package]] @@ -555,7 +552,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.3", "schannel", "security-framework", ] @@ -569,13 +566,30 @@ dependencies = [ "base64", ] +[[package]] +name = "rustls-pemfile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +dependencies = [ + "base64", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb0a1f9b9efec70d32e6d6aa3e58ebd88c3754ec98dfe9145c63cf54cc829b83" + [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "de2635c8bc2b88d367767c5de8ea1d8db9af3f6219eba28442242d9ab81d1b89" dependencies = [ "ring", + "rustls-pki-types", "untrusted", ] @@ -594,16 +608,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "security-framework" version = "2.9.2" @@ -671,9 +675,15 @@ dependencies = [ [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "subtle" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -774,9 +784,9 @@ dependencies = [ [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" @@ -796,7 +806,8 @@ dependencies = [ "once_cell", "rustls", "rustls-native-certs", - "rustls-pemfile", + "rustls-pemfile 2.0.0", + "rustls-pki-types", "rustls-webpki", "serde", "serde_json", @@ -829,75 +840,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "wasm-bindgen" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.87" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] -name = "web-sys" -version = "0.3.64" +name = "webpki-roots" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188" dependencies = [ - "js-sys", - "wasm-bindgen", + "rustls-pki-types", ] -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - [[package]] name = "winapi" version = "0.3.9" @@ -994,3 +950,9 @@ name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" diff --git a/Cargo.toml b/Cargo.toml index 9db57653..e2e1d116 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ rustdoc-args = ["--cfg", "docsrs"] [features] default = ["tls", "gzip"] -tls = ["dep:webpki", "dep:webpki-roots", "dep:rustls"] +tls = ["dep:webpki", "dep:webpki-roots", "dep:rustls", "dep:rustls-pki-types"] native-certs = ["dep:rustls-native-certs"] json = ["dep:serde", "dep:serde_json"] charset = ["dep:encoding_rs"] @@ -43,9 +43,10 @@ serde_json = { version = ">=1.0.97", optional = true } encoding_rs = { version = "0.8", optional = true } cookie_store = { version = "0.20", optional = true, default-features = false, features = ["preserve_order"] } log = "0.4" -webpki = { package = "rustls-webpki", version = "0.101", optional = true } -webpki-roots = { version = "0.25", optional = true } -rustls = { version = "0.21.6", optional = true } +webpki = { package = "rustls-webpki", version = "0.102", optional = true } +webpki-roots = { version = "0.26", optional = true } +rustls = { version = "0.22.0", optional = true } +rustls-pki-types = { version = "1", optional = true } rustls-native-certs = { version = "0.6", optional = true } native-tls = { version = "0.2", optional = true } flate2 = { version = "1.0.22", optional = true } @@ -56,8 +57,8 @@ http = { version = "1.0", optional = true } [dev-dependencies] serde = { version = "1", features = ["derive"] } env_logger = "0.10" -rustls = { version = ">=0.21.6, <0.22", features = ["dangerous_configuration"] } -rustls-pemfile = { version = "1.0" } +rustls = { version = "0.22.0" } +rustls-pemfile = { version = "2.0" } [[example]] name = "cureq" diff --git a/examples/cureq/main.rs b/examples/cureq/main.rs index 3d584bc4..2afd8310 100644 --- a/examples/cureq/main.rs +++ b/examples/cureq/main.rs @@ -3,13 +3,11 @@ use std::fmt; use std::io; use std::thread; use std::time::Duration; -use std::time::SystemTime; use std::{env, sync::Arc}; -use rustls::client::ServerCertVerified; -use rustls::client::ServerCertVerifier; -use rustls::ServerName; -use rustls::{Certificate, ClientConfig}; +use rustls::client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier}; +use rustls::ClientConfig; +use rustls_pki_types::{CertificateDer, ServerName, UnixTime}; use ureq; #[derive(Debug)] @@ -96,20 +94,42 @@ fn perform( Ok(()) } +#[derive(Debug)] struct AcceptAll {} impl ServerCertVerifier for AcceptAll { fn verify_server_cert( &self, - _end_entity: &Certificate, - _intermediates: &[Certificate], + _end_entity: &CertificateDer, + _intermediates: &[CertificateDer], _server_name: &ServerName, - _scts: &mut dyn Iterator, _ocsp_response: &[u8], - _now: SystemTime, + _now: UnixTime, ) -> Result { Ok(ServerCertVerified::assertion()) } + + fn verify_tls12_signature( + &self, + _message: &[u8], + _cert: &CertificateDer<'_>, + _dss: &rustls::DigitallySignedStruct, + ) -> Result { + Ok(HandshakeSignatureValid::assertion()) + } + + fn verify_tls13_signature( + &self, + _message: &[u8], + _cert: &CertificateDer<'_>, + _dss: &rustls::DigitallySignedStruct, + ) -> Result { + Ok(HandshakeSignatureValid::assertion()) + } + + fn supported_verify_schemes(&self) -> Vec { + todo!() + } } fn main() { @@ -165,7 +185,7 @@ Fetch url and copy it to stdout. } "-k" => { let client_config = ClientConfig::builder() - .with_safe_defaults() + .dangerous() .with_custom_certificate_verifier(Arc::new(AcceptAll {})) .with_no_client_auth(); builder = builder.tls_config(Arc::new(client_config)); diff --git a/examples/tls_config.rs b/examples/tls_config.rs index 7746f6d4..ab2549ed 100644 --- a/examples/tls_config.rs +++ b/examples/tls_config.rs @@ -21,23 +21,13 @@ pub fn main() { // } // This adds webpki_roots certs. - root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - rustls::OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) - })); + root_store.roots = webpki_roots::TLS_SERVER_ROOTS.iter().cloned().collect(); // This is how we narrow down the allowed TLS versions for rustls. let protocol_versions = &[&TLS12, &TLS13]; // See rustls documentation for more configuration options. - let tls_config = rustls::ClientConfig::builder() - .with_safe_default_cipher_suites() - .with_safe_default_kx_groups() - .with_protocol_versions(protocol_versions) - .unwrap() + let tls_config = rustls::ClientConfig::builder_with_protocol_versions(protocol_versions) .with_root_certificates(root_store) .with_no_client_auth(); diff --git a/src/agent.rs b/src/agent.rs index 30a0038e..986d3f92 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -595,17 +595,11 @@ impl AgentBuilder { /// # fn main() -> Result<(), ureq::Error> { /// # ureq::is_test(true); /// use std::sync::Arc; - /// let mut root_store = rustls::RootCertStore::empty(); - /// root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - /// rustls::OwnedTrustAnchor::from_subject_spki_name_constraints( - /// ta.subject, - /// ta.spki, - /// ta.name_constraints, - /// ) - /// })); + /// let mut root_store = rustls::RootCertStore { + /// roots: webpki_roots::TLS_SERVER_ROOTS.iter().cloned().collect(), + /// }; /// /// let tls_config = rustls::ClientConfig::builder() - /// .with_safe_defaults() /// .with_root_certificates(root_store) /// .with_no_client_auth(); /// let agent = ureq::builder() diff --git a/src/rtls.rs b/src/rtls.rs index f18adee6..086e6de4 100644 --- a/src/rtls.rs +++ b/src/rtls.rs @@ -64,30 +64,12 @@ fn root_certs() -> rustls::RootCertStore { use log::error; let mut root_cert_store = rustls::RootCertStore::empty(); - - let mut valid_count = 0; - let mut invalid_count = 0; - let certs = rustls_native_certs::load_native_certs().unwrap_or_else(|e| { + let native_certs = rustls_native_certs::load_native_certs().unwrap_or_else(|e| { error!("loading native certificates: {}", e); vec![] }); - for cert in certs { - let cert = rustls::Certificate(cert.0); - // Continue on parsing errors, as native stores often include ancient or syntactically - // invalid certificates, like root certificates without any X509 extensions. - // Inspiration: https://github.com/rustls/rustls/blob/633bf4ba9d9521a95f68766d04c22e2b01e68318/rustls/src/anchors.rs#L105-L112 - match root_cert_store.add(&cert) { - Ok(_) => valid_count += 1, - Err(err) => { - invalid_count += 1; - log::warn!( - "rustls failed to parse DER certificate {:?} {:?}", - &err, - &cert - ); - } - } - } + let (valid_count, invalid_count) = + root_cert_store.add_parsable_certificates(native_certs.into_iter().map(|c| c.0.into())); if valid_count == 0 && invalid_count > 0 { error!( "no valid certificates loaded by rustls-native-certs. all HTTPS requests will fail." @@ -98,15 +80,9 @@ fn root_certs() -> rustls::RootCertStore { #[cfg(not(feature = "native-certs"))] fn root_certs() -> rustls::RootCertStore { - let mut root_store = rustls::RootCertStore::empty(); - root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - rustls::OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) - })); - root_store + rustls::RootCertStore { + roots: webpki_roots::TLS_SERVER_ROOTS.to_vec(), + } } impl TlsConnector for Arc { @@ -122,8 +98,9 @@ impl TlsConnector for Arc { dns_name }; - let sni = rustls::ServerName::try_from(dns_name) - .map_err(|e| ErrorKind::Dns.msg(format!("parsing '{}'", dns_name)).src(e))?; + let sni = rustls_pki_types::ServerName::try_from(dns_name) + .map_err(|e| ErrorKind::Dns.msg(format!("parsing '{}'", dns_name)).src(e))? + .to_owned(); let mut sess = rustls::ClientConnection::new(self.clone(), sni) .map_err(|e| ErrorKind::Io.msg("tls connection creation failed").src(e))?; @@ -142,7 +119,6 @@ impl TlsConnector for Arc { pub fn default_tls_config() -> Arc { static TLS_CONF: Lazy> = Lazy::new(|| { let config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(root_certs()) .with_no_client_auth(); Arc::new(Arc::new(config)) diff --git a/tests/https-agent.rs b/tests/https-agent.rs index 6722bc54..1cb92225 100644 --- a/tests/https-agent.rs +++ b/tests/https-agent.rs @@ -96,26 +96,19 @@ m0Wqhhi8/24Sy934t5Txgkfoltg8ahkx934WjP6WWRnSAu+cf+vW use ureq::OrAnyStatus; let certs = rustls_pemfile::certs(&mut BADSSL_CLIENT_CERT_PEM.as_bytes()) + .collect::, _>>() + .unwrap(); + let key = rustls_pemfile::private_key(&mut BADSSL_CLIENT_CERT_PEM.as_bytes()) .unwrap() - .into_iter() - .map(rustls::Certificate) - .collect(); - let key = rustls_pemfile::rsa_private_keys(&mut BADSSL_CLIENT_CERT_PEM.as_bytes()).unwrap()[0] - .clone(); - - let mut root_store = rustls::RootCertStore::empty(); - root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - rustls::OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) - })); + .unwrap(); + + let root_store = rustls::RootCertStore { + roots: webpki_roots::TLS_SERVER_ROOTS.iter().cloned().collect(), + }; let tls_config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(root_store) - .with_single_cert(certs, rustls::PrivateKey(key)) + .with_client_auth_cert(certs, key) .unwrap(); let agent = ureq::builder() @@ -156,17 +149,11 @@ m0Wqhhi8/24Sy934t5Txgkfoltg8ahkx934WjP6WWRnSAu+cf+vW #[test] #[cfg(any(feature = "tls", feature = "tls-native"))] fn ipv6_addr_in_dns_name() { - let mut root_store = rustls::RootCertStore::empty(); - root_store.add_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { - rustls::OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, - ) - })); + let root_store = rustls::RootCertStore { + roots: webpki_roots::TLS_SERVER_ROOTS.to_vec(), + }; let tls_config = rustls::ClientConfig::builder() - .with_safe_defaults() .with_root_certificates(root_store) .with_no_client_auth(); From 9228547ed477b2dcffc46cfc6e75e599449134ca Mon Sep 17 00:00:00 2001 From: Daniel Dimovski Date: Sat, 29 Apr 2023 18:42:53 +0200 Subject: [PATCH 02/25] Allow a connection attempt to timeout and keep trying resolved addresses --- src/stream.rs | 11 ++++++++++- src/test/agent_test.rs | 29 ++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/src/stream.rs b/src/stream.rs index 98b7da64..8e7a36ee 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -2,6 +2,7 @@ use log::debug; use std::io::{self, BufRead, BufReader, Read, Write}; use std::net::SocketAddr; use std::net::TcpStream; +use std::ops::Div; use std::time::Duration; use std::time::Instant; use std::{fmt, io::Cursor}; @@ -375,10 +376,18 @@ pub(crate) fn connect_host( let mut any_err = None; let mut any_stream_and_addr = None; // Find the first sock_addr that accepts a connection + let multiple_addrs = sock_addrs.len() > 1; + for sock_addr in sock_addrs { // ensure connect timeout or overall timeout aren't yet hit. let timeout = match connect_deadline { - Some(deadline) => Some(time_until_deadline(deadline)?), + Some(deadline) => { + let mut deadline = time_until_deadline(deadline)?; + if multiple_addrs { + deadline = deadline.div(2); + } + Some(deadline) + } None => None, }; diff --git a/src/test/agent_test.rs b/src/test/agent_test.rs index ea0abdac..1fdaedfd 100644 --- a/src/test/agent_test.rs +++ b/src/test/agent_test.rs @@ -3,7 +3,7 @@ use crate::error::Error; use crate::testserver::{read_request, TestServer}; use std::io::{self, Read, Write}; -use std::net::TcpStream; +use std::net::{IpAddr, Ipv4Addr, SocketAddr, TcpStream}; use std::thread; use std::time::Duration; @@ -111,6 +111,33 @@ fn custom_resolver() { assert_eq!(&server.join().unwrap(), b"GET / HTTP/1.1\r\n"); } +#[test] +fn socket_addr_fail_over() { + use std::net::TcpListener; + + let listener = TcpListener::bind("127.0.0.1:0").unwrap(); + + let local_addr = listener.local_addr().unwrap(); + let non_routable_ipv4 = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(10, 255, 255, 1)), 9872); + let server = std::thread::spawn(move || { + let (mut client, _) = listener.accept().unwrap(); + let mut buf = vec![0u8; 16]; + let read = client.read(&mut buf).unwrap(); + buf.truncate(read); + buf + }); + + AgentBuilder::new() + .resolver(move |_: &str| Ok(vec![non_routable_ipv4, local_addr])) + .timeout_connect(Duration::from_secs(2)) + .build() + .get("http://cool.server/") + .call() + .ok(); + + assert_eq!(&server.join().unwrap(), b"GET / HTTP/1.1\r\n"); +} + #[cfg(feature = "cookies")] #[cfg(test)] fn cookie_and_redirect(mut stream: TcpStream) -> io::Result<()> { From 4ddcc3a27a6c8cb88041dc713010455f776fa753 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Mon, 20 Nov 2023 20:48:20 +0100 Subject: [PATCH 03/25] Don't export Header struct This struct does not need to be exported from the crate because it is not used in any public fn - it's internal. This is technically a breaking change, but in practice, not too bad since the struct is not used by the API. --- src/header.rs | 3 ++- src/http_interop.rs | 4 ++-- src/lib.rs | 1 - 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/header.rs b/src/header.rs index ebc2ed1b..057e8f22 100644 --- a/src/header.rs +++ b/src/header.rs @@ -65,7 +65,7 @@ impl fmt::Display for HeaderLine { #[derive(Clone, PartialEq, Eq)] /// Wrapper type for a header field. /// -pub struct Header { +pub(crate) struct Header { // Line contains the unmodified bytes of single header field. // It does not contain the final CRLF. line: HeaderLine, @@ -115,6 +115,7 @@ impl Header { /// /// ureq can't know what encoding the header is in, but this function provides /// an escape hatch for users that need to handle such headers. + #[cfg(any(feature = "http-interop", feature = "charset"))] pub fn value_raw(&self) -> &[u8] { let mut bytes = &self.line.as_bytes()[self.index + 1..]; diff --git a/src/http_interop.rs b/src/http_interop.rs index 2864daa5..1d69dd0c 100644 --- a/src/http_interop.rs +++ b/src/http_interop.rs @@ -10,8 +10,8 @@ use crate::{header::HeaderLine, response::ResponseStatusIndex, Request, Response /// Converts an [`http::Response`] into a [`Response`]. /// /// As an [`http::Response`] does not contain a URL, `"https://example.com/"` is used as a -/// placeholder. Additionally, if the response has a header which cannot be converted into a valid -/// [`Header`](crate::Header), it will be skipped rather than having the conversion fail. The remote +/// placeholder. Additionally, if the response has a header which cannot be converted into +/// the ureq equivalent, it will be skipped rather than having the conversion fail. The remote /// address property will also always be `127.0.0.1:80` for similar reasons to the URL. /// /// ``` diff --git a/src/lib.rs b/src/lib.rs index d6bafe9d..70d42e49 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -430,7 +430,6 @@ pub use crate::agent::Agent; pub use crate::agent::AgentBuilder; pub use crate::agent::RedirectAuthHeaders; pub use crate::error::{Error, ErrorKind, OrAnyStatus, Transport}; -pub use crate::header::Header; pub use crate::middleware::{Middleware, MiddlewareNext}; pub use crate::proxy::Proxy; pub use crate::request::{Request, RequestUrl}; From 754ade98cfec5da93807c4e5b3c83da61c70ba17 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Tue, 26 Dec 2023 10:13:55 +0100 Subject: [PATCH 04/25] Fix some compilation problems due to Header --- src/header.rs | 4 ++-- src/http_crate.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/header.rs b/src/header.rs index 057e8f22..40a3fce6 100644 --- a/src/header.rs +++ b/src/header.rs @@ -115,7 +115,7 @@ impl Header { /// /// ureq can't know what encoding the header is in, but this function provides /// an escape hatch for users that need to handle such headers. - #[cfg(any(feature = "http-interop", feature = "charset"))] + #[allow(unused)] pub fn value_raw(&self) -> &[u8] { let mut bytes = &self.line.as_bytes()[self.index + 1..]; @@ -159,7 +159,7 @@ pub fn get_header<'h>(headers: &'h [Header], name: &str) -> Option<&'h str> { .and_then(|h| h.value()) } -#[cfg(any(doc, all(test, any(feature = "http-interop", feature = "http-crate"))))] +#[allow(unused)] pub fn get_header_raw<'h>(headers: &'h [Header], name: &str) -> Option<&'h [u8]> { headers .iter() diff --git a/src/http_crate.rs b/src/http_crate.rs index ad37d49e..367c74e2 100644 --- a/src/http_crate.rs +++ b/src/http_crate.rs @@ -8,9 +8,9 @@ use crate::{header::HeaderLine, response::ResponseStatusIndex, Request, Response /// Converts an [`http::Response`] into a [`Response`]. /// /// As an [`http::Response`] does not contain a URL, `"https://example.com/"` is used as a -/// placeholder. Additionally, if the response has a header which cannot be converted into a valid -/// [`Header`](crate::Header), it will be skipped rather than having the conversion fail. The remote -/// address property will also always be `127.0.0.1:80` for similar reasons to the URL. +/// placeholder. Additionally, if the response has a header which cannot be converted to ureq's +/// internal header representation, it will be skipped rather than having the conversion fail. +/// The remote address property will also always be `127.0.0.1:80` for similar reasons to the URL. /// /// ``` /// # fn main() -> Result<(), http::Error> { From bfd92c16b857cdad890fdaac42e8fdeb35b3ce70 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Sat, 13 Jan 2024 11:10:32 +0100 Subject: [PATCH 05/25] Allow chunked unused imports --- src/chunked/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/chunked/mod.rs b/src/chunked/mod.rs index 4d85cc40..4402e3b4 100644 --- a/src/chunked/mod.rs +++ b/src/chunked/mod.rs @@ -12,7 +12,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#![allow(dead_code)] +#![allow(dead_code, unused_imports)] mod decoder; pub use decoder::Decoder; From 26ed596c5a411be0126682c8a508ff349a5d4c75 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Sat, 13 Jan 2024 11:13:41 +0100 Subject: [PATCH 06/25] Fix clippy --- src/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/error.rs b/src/error.rs index 9610fc74..805395ec 100644 --- a/src/error.rs +++ b/src/error.rs @@ -212,7 +212,7 @@ impl Display for Error { match self { Error::Status(status, response) => { write!(f, "{}: status code {}", response.get_url(), status)?; - if let Some(original) = response.history.get(0) { + if let Some(original) = response.history.first() { write!(f, " (redirected from {})", original)?; } } From c4e0b36c8f7dc28488591911ca0c5b83dab217ad Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Sat, 20 Jan 2024 14:10:52 +0100 Subject: [PATCH 07/25] Use hootbin for tests --- Cargo.lock | 70 +++++++++++++++++++++++++++++++++++++++-------- Cargo.toml | 3 ++ README.md | 3 +- src/agent.rs | 6 ++-- src/lib.rs | 4 +-- src/request.rs | 2 +- src/response.rs | 18 ++++++------ src/testserver.rs | 61 +++++++++++++++-------------------------- 8 files changed, 100 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a708ff82..abedc7cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -264,6 +264,25 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +[[package]] +name = "hoot" +version = "0.1.2" +dependencies = [ + "httparse", + "log", +] + +[[package]] +name = "hootbin" +version = "0.1.0" +dependencies = [ + "fastrand", + "hoot", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "http" version = "0.2.11" @@ -286,6 +305,12 @@ dependencies = [ "itoa", ] +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + [[package]] name = "humantime" version = "2.1.0" @@ -450,18 +475,18 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -633,18 +658,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", @@ -653,9 +678,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -687,9 +712,9 @@ checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "2.0.37" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -718,6 +743,26 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "time" version = "0.3.29" @@ -799,6 +844,7 @@ dependencies = [ "encoding_rs", "env_logger", "flate2", + "hootbin", "http 0.2.11", "http 1.0.0", "log", diff --git a/Cargo.toml b/Cargo.toml index e2e1d116..23c05122 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,9 @@ brotli-decompressor = { version = "2.3.2", optional = true } http-02 = { package = "http", version = "0.2", optional = true } http = { version = "1.0", optional = true } +# This can't be in dev-dependencies due to doc tests. +hootbin = { version = "0.1.0" } + [dev-dependencies] serde = { version = "1", features = ["derive"] } env_logger = "0.10" diff --git a/README.md b/README.md index 9c2e9a44..ff6eec34 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,8 @@ You can control them when including ureq as a dependency. does nothing for `native-tls`. * `gzip` enables requests of gzip-compressed responses and decompresses them. This is enabled by default. * `brotli` enables requests brotli-compressed responses and decompresses them. -* `http-interop` enables conversion methods to and from `http::Response` and `http::request::Builder`. +* `http-interop` enables conversion methods to and from `http::Response` and `http::request::Builder` (v0.2). +* `http` enables conversion methods to and from `http::Response` and `http::request::Builder` (v1.0). ## Plain requests diff --git a/src/agent.rs b/src/agent.rs index 986d3f92..202869ff 100644 --- a/src/agent.rs +++ b/src/agent.rs @@ -93,11 +93,11 @@ pub(crate) struct AgentConfig { /// let mut agent = ureq::agent(); /// /// agent -/// .post("http://example.com/login") +/// .post("http://example.com/post/login") /// .call()?; /// /// let secret = agent -/// .get("http://example.com/my-protected-page") +/// .get("http://example.com/get/my-protected-page") /// .call()? /// .into_string()?; /// @@ -173,7 +173,7 @@ impl Agent { /// let agent = ureq::agent(); /// /// let mut url: Url = "http://example.com/some-page".parse()?; - /// url.set_path("/robots.txt"); + /// url.set_path("/get/robots.txt"); /// let resp: Response = agent /// .request_url("GET", &url) /// .call()?; diff --git a/src/lib.rs b/src/lib.rs index 70d42e49..a99d1a0a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -104,7 +104,7 @@ //! # fn main() -> std::result::Result<(), ureq::Error> { //! # ureq::is_test(true); //! // Requires the `json` feature enabled. -//! let resp: String = ureq::post("http://myapi.example.com/ingest") +//! let resp: String = ureq::post("http://myapi.example.com/post/ingest") //! .set("X-My-Header", "Secret") //! .send_json(ureq::json!({ //! "name": "martin", @@ -527,7 +527,7 @@ pub fn request(method: &str, path: &str) -> Request { /// let agent = ureq::agent(); /// /// let mut url: Url = "http://example.com/some-page".parse()?; -/// url.set_path("/robots.txt"); +/// url.set_path("/get/robots.txt"); /// let resp: ureq::Response = ureq::request_url("GET", &url) /// .call()?; /// # Ok(()) diff --git a/src/request.rs b/src/request.rs index f92ddde1..33c68eed 100644 --- a/src/request.rs +++ b/src/request.rs @@ -18,7 +18,7 @@ pub type Result = std::result::Result; /// ``` /// # fn main() -> Result<(), ureq::Error> { /// # ureq::is_test(true); -/// let response = ureq::get("http://example.com/form") +/// let response = ureq::get("http://example.com/get") /// .query("foo", "bar baz") // add ?foo=bar+baz /// .call()?; // run the request /// # Ok(()) diff --git a/src/response.rs b/src/response.rs index 4085cb0f..0223068a 100644 --- a/src/response.rs +++ b/src/response.rs @@ -201,8 +201,8 @@ impl Response { /// ``` /// # fn main() -> Result<(), ureq::Error> { /// # ureq::is_test(true); - /// let resp = ureq::get("http://example.com/").call()?; - /// assert!(matches!(resp.header("content-type"), Some("text/html; charset=ISO-8859-1"))); + /// let resp = ureq::get("http://example.com/charset/iso").call()?; + /// assert_eq!(resp.header("content-type"), Some("text/html; charset=ISO-8859-1")); /// assert_eq!("text/html", resp.content_type()); /// # Ok(()) /// # } @@ -225,8 +225,8 @@ impl Response { /// ``` /// # fn main() -> Result<(), ureq::Error> { /// # ureq::is_test(true); - /// let resp = ureq::get("http://example.com/").call()?; - /// assert!(matches!(resp.header("content-type"), Some("text/html; charset=ISO-8859-1"))); + /// let resp = ureq::get("http://example.com/charset/iso").call()?; + /// assert_eq!(resp.header("content-type"), Some("text/html; charset=ISO-8859-1")); /// assert_eq!("ISO-8859-1", resp.charset()); /// # Ok(()) /// # } @@ -500,15 +500,15 @@ impl Response { /// /// #[derive(Deserialize)] /// struct Message { - /// hello: String, + /// text: String, /// } /// /// let message: Message = - /// ureq::get("http://example.com/hello_world.json") + /// ureq::get("http://example.com/get/hello_world.json") /// .call()? /// .into_json()?; /// - /// assert_eq!(message.hello, "world"); + /// assert_eq!(message.text, "Ok"); /// # Ok(()) /// # } /// ``` @@ -520,11 +520,11 @@ impl Response { /// ``` /// # fn main() -> Result<(), ureq::Error> { /// # ureq::is_test(true); - /// let json: serde_json::Value = ureq::get("http://example.com/hello_world.json") + /// let json: serde_json::Value = ureq::get("http://example.com/get/hello_world.json") /// .call()? /// .into_json()?; /// - /// assert_eq!(json["hello"], "world"); + /// assert_eq!(json["text"], "Ok"); /// # Ok(()) /// # } /// ``` diff --git a/src/testserver.rs b/src/testserver.rs index 5df8f6b4..fd844efc 100644 --- a/src/testserver.rs +++ b/src/testserver.rs @@ -1,12 +1,10 @@ +use std::io; +use std::net::ToSocketAddrs; use std::net::{SocketAddr, TcpListener, TcpStream}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Arc; use std::thread; use std::time::Duration; -use std::{ - io::{self, BufRead, BufReader, Write}, - net::ToSocketAddrs, -}; use crate::{Agent, AgentBuilder}; @@ -16,41 +14,23 @@ pub(crate) fn test_agent() -> Agent { #[cfg(test)] let _ = env_logger::try_init(); - let testserver = TestServer::new(|mut stream: TcpStream| -> io::Result<()> { - let headers = read_request(&stream); - if headers.0.is_empty() { - // no headers probably means it's the initial request to check test server is up. - } else if headers.path() == "/status/200" { - stream.write_all(b"HTTP/1.1 200 OK\r\n\r\n")?; - } else if headers.path() == "/status/500" { - stream.write_all(b"HTTP/1.1 500 Server Internal Error\r\n\r\n")?; - } else if headers.path() == "/bytes/100" { - stream.write_all(b"HTTP/1.1 200 OK\r\n")?; - stream.write_all(b"Content-Length: 100\r\n")?; - stream.write_all(b"\r\n")?; - stream.write_all(&[0; 100])?; - } else if headers.path() == "/hello_world.json" { - stream.write_all(b"HTTP/1.1 200 OK\r\n")?; - stream.write_all(b"\r\n")?; - stream.write_all(br#"{"hello": "world"}"#)?; - } else if headers.path() == "/status/301" { - stream.write_all(b"HTTP/1.1 301 Found\r\n")?; - stream.write_all(b"Location: /status/200\r\n")?; - stream.write_all(b"\r\n")?; - } else if headers.path() == "/status/307" { - stream.write_all(b"HTTP/1.1 307 Found\r\n")?; - stream.write_all(b"Location: /status/200\r\n")?; - stream.write_all(b"\r\n")?; - } else { - stream.write_all(b"HTTP/1.1 200 OK\r\n")?; - stream.write_all(b"Transfer-Encoding: chunked\r\n")?; - stream.write_all(b"Content-Type: text/html; charset=ISO-8859-1\r\n")?; - stream.write_all(b"\r\n")?; - stream.write_all(b"7\r\n")?; - stream.write_all(b"success\r\n")?; - stream.write_all(b"0\r\n")?; - stream.write_all(b"\r\n")?; - } + let testserver = TestServer::new(|stream: TcpStream| -> io::Result<()> { + use hootbin::serve_single; + let o = stream.try_clone().expect("TcpStream to be clonable"); + let i = stream; + match serve_single(i, o, "https://hootbin.test/") { + Ok(()) => {} + Err(e) => { + if let hootbin::Error::Io(ioe) = &e { + if ioe.kind() == io::ErrorKind::UnexpectedEof { + // accept this. the pre-connect below is always erroring. + return Ok(()); + } + } + + println!("TestServer error: {:?}", e); + } + }; Ok(()) }); // Slightly tricky thing here: we want to make sure the TestServer lives @@ -97,7 +77,10 @@ impl TestHeaders { // Read a stream until reaching a blank line, in order to consume // request headers. +#[cfg(test)] pub fn read_request(stream: &TcpStream) -> TestHeaders { + use std::io::{BufRead, BufReader}; + let mut results = vec![]; for line in BufReader::new(stream).lines() { match line { From c0a6e54eafcc68cde93a41b74a9d9525b962b967 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Tue, 30 Jan 2024 21:21:41 +0100 Subject: [PATCH 08/25] Update deps --- Cargo.lock | 408 ++++++++++++++++++++++++++++++++-------------------- Cargo.toml | 10 +- src/rtls.rs | 2 +- 3 files changed, 260 insertions(+), 160 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index abedc7cd..a7913662 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,9 +10,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -32,6 +32,54 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "anstream" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -40,9 +88,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bitflags" @@ -52,15 +100,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "brotli-decompressor" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -68,9 +116,9 @@ dependencies = [ [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -93,6 +141,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "cookie" version = "0.17.0" @@ -123,9 +177,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -133,9 +187,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "crc32fast" @@ -148,9 +202,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "encoding_rs" @@ -162,37 +219,36 @@ dependencies = [ ] [[package]] -name = "env_logger" -version = "0.10.0" +name = "env_filter" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" dependencies = [ - "humantime", - "is-terminal", "log", "regex", - "termcolor", ] [[package]] -name = "errno" -version = "0.3.3" +name = "env_logger" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", + "anstream", + "anstyle", + "env_filter", + "humantime", + "log", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "errno" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -203,9 +259,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -234,18 +290,18 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -258,15 +314,11 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hermit-abi" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" - [[package]] name = "hoot" version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf87063f47b6f7e47e6a187fcf6c545ebef7413a441a6d0c9cb83afe8734e43d" dependencies = [ "httparse", "log", @@ -275,6 +327,8 @@ dependencies = [ [[package]] name = "hootbin" version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f740d734450d64288038db65cddfeda703a7d3865b2f0352ac61a2971433623f" dependencies = [ "fastrand", "hoot", @@ -337,22 +391,11 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix", - "windows-sys", -] - [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "lazy_static" @@ -362,15 +405,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" @@ -380,9 +423,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.3" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "miniz_oxide" @@ -413,17 +456,17 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -451,9 +494,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -463,21 +506,27 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" + +[[package]] +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -493,18 +542,18 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.9.5" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -514,9 +563,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -525,42 +574,42 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ring" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom", "libc", "spin", "untrusted", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "rustix" -version = "0.38.15" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2f9da0cbd88f9f09e7814e388301c8414c51c62aa6ce1e4b5c551d49d96e531" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.22.0" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc238b76c51bbc449c55ffbc39d03772a057cc8cf783c49d4af4c2537b74a8b" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", "ring", @@ -572,25 +621,17 @@ dependencies = [ [[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 1.0.3", + "rustls-pemfile", + "rustls-pki-types", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" -dependencies = [ - "base64", -] - [[package]] name = "rustls-pemfile" version = "2.0.0" @@ -603,15 +644,15 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb0a1f9b9efec70d32e6d6aa3e58ebd88c3754ec98dfe9145c63cf54cc829b83" +checksum = "9e9d979b3ce68192e42760c7810125eb6cf2ea10efae545a156063e61f314e2a" [[package]] name = "rustls-webpki" -version = "0.102.0" +version = "0.102.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2635c8bc2b88d367767c5de8ea1d8db9af3f6219eba28442242d9ab81d1b89" +checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b" dependencies = [ "ring", "rustls-pki-types", @@ -620,17 +661,17 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -658,18 +699,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -678,9 +719,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -723,24 +764,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand", "redox_syscall", "rustix", - "windows-sys", -] - -[[package]] -name = "termcolor" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" -dependencies = [ - "winapi-util", + "windows-sys 0.52.0", ] [[package]] @@ -765,12 +797,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", + "powerfmt", "serde", "time-core", "time-macros", @@ -784,9 +817,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -808,9 +841,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -852,7 +885,7 @@ dependencies = [ "once_cell", "rustls", "rustls-native-certs", - "rustls-pemfile 2.0.0", + "rustls-pemfile", "rustls-pki-types", "rustls-webpki", "serde", @@ -873,6 +906,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "vcpkg" version = "0.2.15" @@ -916,15 +955,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -937,7 +967,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -946,13 +985,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -961,42 +1015,84 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "zeroize" version = "1.7.0" diff --git a/Cargo.toml b/Cargo.toml index 23c05122..e563f257 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,9 +34,13 @@ proxy-from-env = [] [dependencies] base64 = "0.21" +# cookie_store 0.20 pins cookie at v0.17 cookie = { version = "0.17", default-features = false, optional = true } once_cell = "1" -url = "2" +# cookie_store 0.20 pins idna at v0.3.0 +# url > 2.3.1 brings in idna v0.5.0, so this dep +# must be fixed until cookie_store upgrades to cookie v0.18 +url = "=2.3.1" socks = { version = "0.3", optional = true } serde = { version = "1", optional = true } serde_json = { version = ">=1.0.97", optional = true } @@ -47,7 +51,7 @@ webpki = { package = "rustls-webpki", version = "0.102", optional = true } webpki-roots = { version = "0.26", optional = true } rustls = { version = "0.22.0", optional = true } rustls-pki-types = { version = "1", optional = true } -rustls-native-certs = { version = "0.6", optional = true } +rustls-native-certs = { version = "0.7", optional = true } native-tls = { version = "0.2", optional = true } flate2 = { version = "1.0.22", optional = true } brotli-decompressor = { version = "2.3.2", optional = true } @@ -59,7 +63,7 @@ hootbin = { version = "0.1.0" } [dev-dependencies] serde = { version = "1", features = ["derive"] } -env_logger = "0.10" +env_logger = "0.11.1" rustls = { version = "0.22.0" } rustls-pemfile = { version = "2.0" } diff --git a/src/rtls.rs b/src/rtls.rs index 086e6de4..5081ef72 100644 --- a/src/rtls.rs +++ b/src/rtls.rs @@ -69,7 +69,7 @@ fn root_certs() -> rustls::RootCertStore { vec![] }); let (valid_count, invalid_count) = - root_cert_store.add_parsable_certificates(native_certs.into_iter().map(|c| c.0.into())); + root_cert_store.add_parsable_certificates(native_certs.into_iter().map(|c| c.into())); if valid_count == 0 && invalid_count > 0 { error!( "no valid certificates loaded by rustls-native-certs. all HTTPS requests will fail." From 2c58da106b1511280f656068b4d640908e716321 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Tue, 30 Jan 2024 21:42:32 +0100 Subject: [PATCH 09/25] Update changelog --- CHANGELOG.md | 11 +++++++++++ Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d5a66ce..5c581cc8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +# 2.9.2 + +## Added + + * Replace dependency on httpbin.org for tests/doc-tests. (#703) + +## Fixed + + * Remove Header struct that never should have been exported. (#696) + * Update deps (rustls 0.22) (#690) + # 2.9.1 ## Fixed diff --git a/Cargo.toml b/Cargo.toml index e563f257..1dba19c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ureq" -version = "2.9.1" +version = "2.9.2" authors = ["Martin Algesten ", "Jacob Hoffman-Andrews "] description = "Simple, safe HTTP client" license = "MIT OR Apache-2.0" From 781edf8e284b62b2f445db980dafadf49ad90fb4 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Tue, 30 Jan 2024 21:53:06 +0100 Subject: [PATCH 10/25] Update lock file --- Cargo.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index a7913662..ded1b63e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -868,7 +868,7 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.1" +version = "2.9.2" dependencies = [ "base64", "brotli-decompressor", From 75eb8ccb7af3c93e26db9201cf42df6e8aefc918 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Tue, 30 Jan 2024 22:01:11 +0100 Subject: [PATCH 11/25] Fix docs.rs features --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1dba19c0..a82c1418 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,14 +11,14 @@ categories = ["web-programming::http-client"] edition = "2018" [package.metadata.docs.rs] -# features = ["tls", "dep:native-tls", "json", "charset", "cookies", "socks-proxy", "gzip", "brotli", "http-interop"] -features = "all" +features = ["tls", "native-tls", "json", "charset", "cookies", "socks-proxy", "gzip", "brotli", "http-interop"] rustdoc-args = ["--cfg", "docsrs"] [features] default = ["tls", "gzip"] tls = ["dep:webpki", "dep:webpki-roots", "dep:rustls", "dep:rustls-pki-types"] native-certs = ["dep:rustls-native-certs"] +native-tls = ["dep:native-tls"] json = ["dep:serde", "dep:serde_json"] charset = ["dep:encoding_rs"] cookies = ["dep:cookie", "dep:cookie_store"] From 1759083d32aca94938152fd39ec5413364c7355a Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Tue, 30 Jan 2024 22:01:24 +0100 Subject: [PATCH 12/25] 2.9.3 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a82c1418..3926f89c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ureq" -version = "2.9.2" +version = "2.9.3" authors = ["Martin Algesten ", "Jacob Hoffman-Andrews "] description = "Simple, safe HTTP client" license = "MIT OR Apache-2.0" From ec6cbbada377cb7d23eb405f902010cdb6e7b1bb Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Tue, 30 Jan 2024 22:01:55 +0100 Subject: [PATCH 13/25] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c581cc8..27f54f70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.9.3 + +## Fixed + + * docs.rs docs + # 2.9.2 ## Added From b48f5a7641bfb9b7157baa1bd3af7cb895f40ab3 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Wed, 31 Jan 2024 10:08:22 +0100 Subject: [PATCH 14/25] MSRV 1.61 --- .github/workflows/test.yml | 21 +++++++ Cargo.lock | 118 ++++++++++++++----------------------- Cargo.toml | 4 +- src/header.rs | 10 ++-- 4 files changed, 71 insertions(+), 82 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d6f86dc..08fa3c4a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -41,6 +41,27 @@ jobs: with: command: doc args: --no-deps --all-features --document-private-items + + build_versions: + strategy: + matrix: + rust: [stable, beta, 1.61.0] + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + - uses: Swatinem/rust-cache@v1 + - uses: actions-rs/cargo@v1 + with: + command: build + - uses: actions-rs/cargo@v1 + with: + command: build + build_and_test: name: Test runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index ded1b63e..398dce71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,51 +33,14 @@ dependencies = [ ] [[package]] -name = "anstream" -version = "0.6.11" +name = "atty" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" - -[[package]] -name = "anstyle-parse" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" -dependencies = [ - "windows-sys 0.52.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", + "hermit-abi", + "libc", + "winapi", ] [[package]] @@ -141,12 +104,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - [[package]] name = "cookie" version = "0.17.0" @@ -218,27 +175,17 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "env_filter" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" -dependencies = [ - "log", - "regex", -] - [[package]] name = "env_logger" -version = "0.11.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ - "anstream", - "anstyle", - "env_filter", + "atty", "humantime", "log", + "regex", + "termcolor", ] [[package]] @@ -314,11 +261,20 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hoot" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf87063f47b6f7e47e6a187fcf6c545ebef7413a441a6d0c9cb83afe8734e43d" +checksum = "df22a4d90f1b0e65fe3e0d6ee6a4608cc4d81f4b2eb3e670f44bb6bde711e452" dependencies = [ "httparse", "log", @@ -326,9 +282,9 @@ dependencies = [ [[package]] name = "hootbin" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f740d734450d64288038db65cddfeda703a7d3865b2f0352ac61a2971433623f" +checksum = "354e60868e49ea1a39c44b9562ad207c4259dc6eabf9863bf3b0f058c55cfdb2" dependencies = [ "fastrand", "hoot", @@ -775,6 +731,15 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "thiserror" version = "1.0.56" @@ -868,7 +833,7 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.2" +version = "2.9.3" dependencies = [ "base64", "brotli-decompressor", @@ -906,12 +871,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - [[package]] name = "vcpkg" version = "0.2.15" @@ -955,6 +914,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index 3926f89c..c29912e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,11 +59,11 @@ http-02 = { package = "http", version = "0.2", optional = true } http = { version = "1.0", optional = true } # This can't be in dev-dependencies due to doc tests. -hootbin = { version = "0.1.0" } +hootbin = { version = "0.1.1" } [dev-dependencies] serde = { version = "1", features = ["derive"] } -env_logger = "0.11.1" +env_logger = "<=0.9" rustls = { version = "0.22.0" } rustls-pemfile = { version = "2.0" } diff --git a/src/header.rs b/src/header.rs index 40a3fce6..053c8c5a 100644 --- a/src/header.rs +++ b/src/header.rs @@ -152,7 +152,7 @@ impl Header { } /// For non-utf8 headers this returns [`None`] (use [`get_header_raw()`]). -pub fn get_header<'h>(headers: &'h [Header], name: &str) -> Option<&'h str> { +pub(crate) fn get_header<'h>(headers: &'h [Header], name: &str) -> Option<&'h str> { headers .iter() .find(|h| h.is_name(name)) @@ -160,14 +160,14 @@ pub fn get_header<'h>(headers: &'h [Header], name: &str) -> Option<&'h str> { } #[allow(unused)] -pub fn get_header_raw<'h>(headers: &'h [Header], name: &str) -> Option<&'h [u8]> { +pub(crate) fn get_header_raw<'h>(headers: &'h [Header], name: &str) -> Option<&'h [u8]> { headers .iter() .find(|h| h.is_name(name)) .map(|h| h.value_raw()) } -pub fn get_all_headers<'h>(headers: &'h [Header], name: &str) -> Vec<&'h str> { +pub(crate) fn get_all_headers<'h>(headers: &'h [Header], name: &str) -> Vec<&'h str> { headers .iter() .filter(|h| h.is_name(name)) @@ -175,11 +175,11 @@ pub fn get_all_headers<'h>(headers: &'h [Header], name: &str) -> Vec<&'h str> { .collect() } -pub fn has_header(headers: &[Header], name: &str) -> bool { +pub(crate) fn has_header(headers: &[Header], name: &str) -> bool { get_header(headers, name).is_some() } -pub fn add_header(headers: &mut Vec
, header: Header) { +pub(crate) fn add_header(headers: &mut Vec
, header: Header) { let name = header.name(); if !name.starts_with("x-") && !name.starts_with("X-") { headers.retain(|h| h.name() != name); From 48de0d2375c62799530c3046c660903af428805a Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Wed, 31 Jan 2024 10:23:14 +0100 Subject: [PATCH 15/25] Set rust-version to 1.61 --- Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index c29912e5..4bcbe6a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,10 @@ keywords = ["web", "request", "https", "http", "client"] categories = ["web-programming::http-client"] edition = "2018" + +# MSRV +rust-version = "1.61" + [package.metadata.docs.rs] features = ["tls", "native-tls", "json", "charset", "cookies", "socks-proxy", "gzip", "brotli", "http-interop"] rustdoc-args = ["--cfg", "docsrs"] From f36354b1317ef7ee01db54799cc1f23fef4a625a Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Wed, 31 Jan 2024 10:23:49 +0100 Subject: [PATCH 16/25] Changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27f54f70..16b33fd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 2.9.4 + +## Fixed + + * MSRV 1.61 with CI tests + # 2.9.3 ## Fixed From 2300a5b3787b1ac800314dc47f075f4850026bb3 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Wed, 31 Jan 2024 10:24:04 +0100 Subject: [PATCH 17/25] 2.9.4 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 398dce71..eda668f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -833,7 +833,7 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.3" +version = "2.9.4" dependencies = [ "base64", "brotli-decompressor", diff --git a/Cargo.toml b/Cargo.toml index 4bcbe6a8..ecd9de2e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ureq" -version = "2.9.3" +version = "2.9.4" authors = ["Martin Algesten ", "Jacob Hoffman-Andrews "] description = "Simple, safe HTTP client" license = "MIT OR Apache-2.0" From 825e7ab897950227e313a08ef413ee75920c6d91 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Tue, 6 Feb 2024 17:42:42 +0100 Subject: [PATCH 18/25] Add AgentBuilder::timeout to FUTURE.md --- FUTURE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/FUTURE.md b/FUTURE.md index 2423423a..6fee95f4 100644 --- a/FUTURE.md +++ b/FUTURE.md @@ -1,2 +1,3 @@ +- Make `AgentBuilder::timeout` be a truly global timeout, including for `connect`. - Replace `impl From for Request` with `TryFrom` because the conversion is fallible (implement in terms of `From`: `builder.body(())?.into_parts().0.into()`); From 55c9b1901abc2b3bce913c9b8fd493f707158aac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Bj=C3=A4reholt?= Date: Thu, 4 Jan 2024 14:50:56 +0100 Subject: [PATCH 19/25] ntls: Convert native_tls::WouldBlock to io::Error::TimedOut When the tls handshake starts and the server doesn't respond, the std::net::TcpStream will return WouldBlock or TimedOut when a read/write times out to the socket, which in turn native_tls will convert to a HandshakeError::WouldBlock. Instead of returning back a io::Error with no type, return io::Error with kind TimedOut. --- src/ntls.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ntls.rs b/src/ntls.rs index 829f59b3..78e33d32 100644 --- a/src/ntls.rs +++ b/src/ntls.rs @@ -17,9 +17,12 @@ impl TlsConnector for native_tls::TlsConnector { native_tls::HandshakeError::Failure(e) => ErrorKind::ConnectionFailed .msg("native_tls connect failed") .src(e), - native_tls::HandshakeError::WouldBlock(_) => { - ErrorKind::Io.msg("Unexpected native_tls::HandshakeError::WouldBlock") - } + native_tls::HandshakeError::WouldBlock(_) => ErrorKind::Io + .msg("native_tls handshake timed out") + .src(std::io::Error::new( + std::io::ErrorKind::TimedOut, + "native_tls handshake timed out", + )), })?; Ok(Box::new(stream)) From 9d770431cf8c9b15eb7b8e2aed7eee681774df7e Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Thu, 8 Feb 2024 23:08:31 +0000 Subject: [PATCH 20/25] Update deps * Updates `cookie` from `0.17` to `0.18` * Updates `cookie_store` from `0.20` to `0.21` * Unpins `url` now that `cookie_store`'s deps have been updated to match the latest `cookie` and `url` versions, so there will not be any duplicate dependencies. * Regenerates `Cargo.lock` to clean up the duplicates and pick up some other small transitive dependency updates. Changelogs: https://github.com/SergioBenitez/cookie-rs/blob/master/CHANGELOG.md#version-0180-oct-9-2023 https://github.com/pfernie/cookie_store/blob/master/CHANGELOG.md#0210---2024-02-08 https://github.com/servo/rust-url/releases/tag/v2.4.0 https://github.com/servo/rust-url/releases/tag/v2.4.1 https://github.com/servo/rust-url/releases/tag/v2.5.0 Closes #720. --- CHANGELOG.md | 6 ++++ Cargo.lock | 92 +++++++++++++++++++++++++--------------------------- Cargo.toml | 10 ++---- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16b33fd0..30c79745 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Unreleased + +## Fixed + + * Update deps (`cookie` 0.18, `cookie_store` 0.21, unpin `url`). (#722) + # 2.9.4 ## Fixed diff --git a/Cargo.lock b/Cargo.lock index eda668f0..7c851ad5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,12 +43,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - [[package]] name = "base64" version = "0.21.7" @@ -106,9 +100,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "cookie" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" +checksum = "3cd91cf61412820176e137621345ee43b3f4423e589e7ae4e50d601d93e35ef8" dependencies = [ "percent-encoding", "time", @@ -117,9 +111,9 @@ dependencies = [ [[package]] name = "cookie_store" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387461abbc748185c3a6e1673d826918b450b87ff22639429c694619a83b6cf6" +checksum = "4934e6b7e8419148b6ef56950d277af8561060b56afd59e2aadf98b59fce6baa" dependencies = [ "cookie", "idna", @@ -188,6 +182,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" version = "0.3.8" @@ -257,9 +257,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "hermit-abi" @@ -329,9 +329,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "idna" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -339,11 +339,11 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ - "autocfg", + "equivalent", "hashbrown", ] @@ -361,9 +361,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linux-raw-sys" @@ -385,9 +385,9 @@ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -410,6 +410,12 @@ dependencies = [ "tempfile", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "once_cell" version = "1.19.0" @@ -496,15 +502,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "regex" version = "1.10.3" @@ -550,9 +547,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", "errno", @@ -600,15 +597,15 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9d979b3ce68192e42760c7810125eb6cf2ea10efae545a156063e61f314e2a" +checksum = "0a716eb65e3158e90e17cd93d855216e27bde02745ab842f2cab4a39dba1bacf" [[package]] name = "rustls-webpki" -version = "0.102.1" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ "ring", "rustls-pki-types", @@ -720,13 +717,12 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] @@ -762,12 +758,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -782,10 +779,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -862,9 +860,9 @@ dependencies = [ [[package]] name = "url" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -891,9 +889,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "webpki-roots" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" dependencies = [ "rustls-pki-types", ] diff --git a/Cargo.toml b/Cargo.toml index ecd9de2e..3dce5057 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,18 +38,14 @@ proxy-from-env = [] [dependencies] base64 = "0.21" -# cookie_store 0.20 pins cookie at v0.17 -cookie = { version = "0.17", default-features = false, optional = true } +cookie = { version = "0.18", default-features = false, optional = true } once_cell = "1" -# cookie_store 0.20 pins idna at v0.3.0 -# url > 2.3.1 brings in idna v0.5.0, so this dep -# must be fixed until cookie_store upgrades to cookie v0.18 -url = "=2.3.1" +url = "2" socks = { version = "0.3", optional = true } serde = { version = "1", optional = true } serde_json = { version = ">=1.0.97", optional = true } encoding_rs = { version = "0.8", optional = true } -cookie_store = { version = "0.20", optional = true, default-features = false, features = ["preserve_order"] } +cookie_store = { version = "0.21", optional = true, default-features = false, features = ["preserve_order"] } log = "0.4" webpki = { package = "rustls-webpki", version = "0.102", optional = true } webpki-roots = { version = "0.26", optional = true } From 5178597e8ce24defaa1666af00ed56e5e3628a91 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Fri, 9 Feb 2024 09:16:02 +0100 Subject: [PATCH 21/25] 2.9.5 --- CHANGELOG.md | 2 ++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30c79745..0430f3be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +# 2.9.5 + ## Fixed * Update deps (`cookie` 0.18, `cookie_store` 0.21, unpin `url`). (#722) diff --git a/Cargo.lock b/Cargo.lock index 7c851ad5..7011a37a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -831,7 +831,7 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.4" +version = "2.9.5" dependencies = [ "base64", "brotli-decompressor", diff --git a/Cargo.toml b/Cargo.toml index 3dce5057..abdf481d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ureq" -version = "2.9.4" +version = "2.9.5" authors = ["Martin Algesten ", "Jacob Hoffman-Andrews "] description = "Simple, safe HTTP client" license = "MIT OR Apache-2.0" From 4ea0a0a057e1df84baf7be92d4e094ae88db1bef Mon Sep 17 00:00:00 2001 From: Michel Lind Date: Tue, 13 Feb 2024 14:06:22 -0600 Subject: [PATCH 22/25] Exclude unnecessary files from being packaged These files are unnecessary, and some cause issues (e.g. when packaged in Fedora, having shell scripts creates a package dependency on Bash) Signed-off-by: Michel Lind --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index abdf481d..2f4b68ed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ readme = "README.md" keywords = ["web", "request", "https", "http", "client"] categories = ["web-programming::http-client"] edition = "2018" +exclude = ["/cargo_deny.sh", "/deny.toml", "/test.sh"] # MSRV From 2812bb7b7c842ad407540638eb28df9d117357c5 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Fri, 16 Feb 2024 07:06:44 +0100 Subject: [PATCH 23/25] testdeps feature to pull in hootbin when needed This PR makes it so tests must run using the `testdeps` feature. That means hootbin can be an optional dependency and thus not being a forced dependency on our users. --- .github/workflows/test.yml | 2 +- Cargo.toml | 4 +++- src/testserver.rs | 46 ++++++++++++++++++++++---------------- test.sh | 4 ++-- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 08fa3c4a..02d4a1ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -97,7 +97,7 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --no-default-features --features "${{ matrix.tls }} ${{ matrix.feature }}" + args: --no-default-features --features "testdeps ${{ matrix.tls }} ${{ matrix.feature }}" cargo-deny: diff --git a/Cargo.toml b/Cargo.toml index 2f4b68ed..2bdd3ec9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,8 @@ http-interop = ["dep:http-02"] # http-crate is for http crate version 1.0 (full release) http-crate = ["dep:http"] proxy-from-env = [] +# Doc tests require hootbin. +testdeps = ["dep:hootbin"] [dependencies] base64 = "0.21" @@ -60,7 +62,7 @@ http-02 = { package = "http", version = "0.2", optional = true } http = { version = "1.0", optional = true } # This can't be in dev-dependencies due to doc tests. -hootbin = { version = "0.1.1" } +hootbin = { version = "0.1.1", optional = true } [dev-dependencies] serde = { version = "1", features = ["derive"] } diff --git a/src/testserver.rs b/src/testserver.rs index fd844efc..293caf68 100644 --- a/src/testserver.rs +++ b/src/testserver.rs @@ -8,31 +8,39 @@ use std::time::Duration; use crate::{Agent, AgentBuilder}; +#[cfg(not(feature = "testdeps"))] +fn test_server_handler(_stream: TcpStream) -> io::Result<()> { + Ok(()) +} + +#[cfg(feature = "testdeps")] +fn test_server_handler(stream: TcpStream) -> io::Result<()> { + use hootbin::serve_single; + let o = stream.try_clone().expect("TcpStream to be clonable"); + let i = stream; + match serve_single(i, o, "https://hootbin.test/") { + Ok(()) => {} + Err(e) => { + if let hootbin::Error::Io(ioe) = &e { + if ioe.kind() == io::ErrorKind::UnexpectedEof { + // accept this. the pre-connect below is always erroring. + return Ok(()); + } + } + + println!("TestServer error: {:?}", e); + } + }; + Ok(()) +} + // An agent to be installed by default for tests and doctests, such // that all hostnames resolve to a TestServer on localhost. pub(crate) fn test_agent() -> Agent { #[cfg(test)] let _ = env_logger::try_init(); - let testserver = TestServer::new(|stream: TcpStream| -> io::Result<()> { - use hootbin::serve_single; - let o = stream.try_clone().expect("TcpStream to be clonable"); - let i = stream; - match serve_single(i, o, "https://hootbin.test/") { - Ok(()) => {} - Err(e) => { - if let hootbin::Error::Io(ioe) = &e { - if ioe.kind() == io::ErrorKind::UnexpectedEof { - // accept this. the pre-connect below is always erroring. - return Ok(()); - } - } - - println!("TestServer error: {:?}", e); - } - }; - Ok(()) - }); + let testserver = TestServer::new(test_server_handler); // Slightly tricky thing here: we want to make sure the TestServer lives // as long as the agent. This is accomplished by `move`ing it into the // closure, which becomes owned by the agent. diff --git a/test.sh b/test.sh index d5fa3df0..4bfa42f2 100755 --- a/test.sh +++ b/test.sh @@ -5,8 +5,8 @@ export RUST_BACKTRACE=1 export RUSTFLAGS="-D dead_code -D unused-variables -D unused" for feature in "" tls json charset cookies socks-proxy "tls native-certs" native-tls gzip brotli http-interop http-crate; do - if ! cargo test --no-default-features --features "${feature}" ; then - echo Command failed: cargo test --no-default-features --features \"${feature}\" + if ! cargo test --no-default-features --features "testdeps ${feature}" ; then + echo Command failed: cargo test --no-default-features --features \"testdeps ${feature}\" exit 1 fi done From 3665d6bf7981f557ef89a60a922f9539aa83d582 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Fri, 16 Feb 2024 07:16:17 +0100 Subject: [PATCH 24/25] hootbin 0.1.5 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- src/response.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7011a37a..75896c63 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -272,9 +272,9 @@ dependencies = [ [[package]] name = "hoot" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df22a4d90f1b0e65fe3e0d6ee6a4608cc4d81f4b2eb3e670f44bb6bde711e452" +checksum = "fceae3b65325d8086333faa87d165c595464b57a50963911a5a2c1ee87cd4e56" dependencies = [ "httparse", "log", @@ -282,9 +282,9 @@ dependencies = [ [[package]] name = "hootbin" -version = "0.1.1" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "354e60868e49ea1a39c44b9562ad207c4259dc6eabf9863bf3b0f058c55cfdb2" +checksum = "ebcf9e17911ae109a3abe00cd094ff6a5d36e36a10694b7db827fdf30d36c1b8" dependencies = [ "fastrand", "hoot", diff --git a/Cargo.toml b/Cargo.toml index 2bdd3ec9..3705892d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ http-02 = { package = "http", version = "0.2", optional = true } http = { version = "1.0", optional = true } # This can't be in dev-dependencies due to doc tests. -hootbin = { version = "0.1.1", optional = true } +hootbin = { version = "0.1.5", optional = true } [dev-dependencies] serde = { version = "1", features = ["derive"] } diff --git a/src/response.rs b/src/response.rs index 0223068a..1cc48e97 100644 --- a/src/response.rs +++ b/src/response.rs @@ -435,7 +435,7 @@ impl Response { /// ``` /// # fn main() -> Result<(), ureq::Error> { /// # ureq::is_test(true); - /// let text = ureq::get("http://httpbin.org/get/success") + /// let text = ureq::get("http://httpbin.org/get?success") /// .call()? /// .into_string()?; /// From 4e3169f212153f44d8ab58d174224e13fe1d0fa0 Mon Sep 17 00:00:00 2001 From: Martin Algesten Date: Fri, 16 Feb 2024 08:04:03 +0100 Subject: [PATCH 25/25] 2.9.6 --- CHANGELOG.md | 7 +++++++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0430f3be..098fd7c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Unreleased +# 2.9.6 + +## Fixed + + * `hootbin` is optional dep. Tests must be run with feature `testdeps` (#729) + * Exclude script files from cargo package (#728) + # 2.9.5 ## Fixed diff --git a/Cargo.lock b/Cargo.lock index 75896c63..e7827823 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -831,7 +831,7 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.5" +version = "2.9.6" dependencies = [ "base64", "brotli-decompressor", diff --git a/Cargo.toml b/Cargo.toml index 3705892d..9375234e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ureq" -version = "2.9.5" +version = "2.9.6" authors = ["Martin Algesten ", "Jacob Hoffman-Andrews "] description = "Simple, safe HTTP client" license = "MIT OR Apache-2.0"