Skip to content

Commit a7174e3

Browse files
committed
deps!: Bump dependencies (#58)
These version bumps bring our dependencies up to the latest versions. This is technically a breaking change since we export the `HttpsConnector` from `hyper_rustls`, and the structure of that has changed. We now need to rely on the `HttpsConnectorBuilder`.
1 parent d082dec commit a7174e3

File tree

6 files changed

+25
-16
lines changed

6 files changed

+25
-16
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
jobs:
44
build:
55
docker:
6-
- image: cimg/rust:1.63.0
6+
- image: cimg/rust:1.67.0
77
steps:
88
- checkout
99
- run:

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ members = [
44
"contract-tests",
55
"eventsource-client"
66
]
7+
8+
resolver = "2"

contract-tests/Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ futures = { version = "0.3.21" }
99
serde = { version = "1.0", features = ["derive"] }
1010
eventsource-client = { path = "../eventsource-client" }
1111
serde_json = { version = "1.0.39"}
12-
actix = { version = "0.12.0"}
13-
actix-web = { version = "4.0.0-beta.10"}
14-
reqwest = { version = "0.11.6", default_features = false, features = ["json", "rustls-tls"] }
15-
env_logger = { version = "0.7.1" }
12+
actix = { version = "0.13.1"}
13+
actix-web = { version = "4"}
14+
reqwest = { version = "0.11.6", default-features = false, features = ["json", "rustls-tls"] }
15+
env_logger = { version = "0.10.0" }
1616
hyper = { version = "0.14.17", features = ["client", "http1", "tcp"] }
1717
log = "0.4.6"
1818

1919
[[bin]]
2020
name = "sse-test-api"
21-

eventsource-client/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@ exclude = [
1515
[dependencies]
1616
futures = "0.3.21"
1717
hyper = { version = "0.14.17", features = ["client", "http1", "tcp"] }
18-
hyper-rustls = { version = "0.22.1", optional = true }
18+
hyper-rustls = { version = "0.24.1", optional = true }
1919
log = "0.4.6"
2020
pin-project = "1.0.10"
2121
tokio = { version = "1.17.0", features = ["time"] }
2222
hyper-timeout = "0.4.1"
2323
rand = "0.8.5"
2424

2525
[dev-dependencies]
26-
env_logger = "0.7.1"
26+
env_logger = "0.10.0"
2727
maplit = "1.0.1"
28-
simplelog = "0.5.3"
28+
simplelog = "0.12.1"
2929
tokio = { version = "1.2.0", features = ["macros", "rt-multi-thread"] }
30-
test-case = "1.2.3"
30+
test-case = "3.2.1"
3131
proptest = "1.0.0"
3232

3333

3434
[features]
3535
default = ["rustls"]
36-
rustls = ["hyper-rustls", "hyper/http2"]
36+
rustls = ["hyper-rustls", "hyper-rustls/http2"]
3737

3838
[[example]]
3939
name = "tail"

eventsource-client/src/client.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ use hyper::{
99
service::Service,
1010
Body, Request, StatusCode, Uri,
1111
};
12-
#[cfg(feature = "rustls")]
13-
use hyper_rustls::HttpsConnector as RustlsConnector;
1412
use log::{debug, info, trace, warn};
1513
use pin_project::pin_project;
1614
use std::{
@@ -41,6 +39,10 @@ use crate::event_parser::SSE;
4139
use crate::retry::{BackoffRetry, RetryStrategy};
4240
use std::error::Error as StdError;
4341

42+
#[cfg(feature = "rustls")]
43+
use hyper_rustls::HttpsConnector as RustlsConnector;
44+
#[cfg(feature = "rustls")]
45+
pub use hyper_rustls::HttpsConnectorBuilder;
4446
#[cfg(feature = "rustls")]
4547
pub type HttpsConnector = RustlsConnector<HttpConnector>;
4648

@@ -187,7 +189,13 @@ impl ClientBuilder {
187189
#[cfg(feature = "rustls")]
188190
/// Build with an HTTPS client connector, using the OS root certificate store.
189191
pub fn build(self) -> impl Client {
190-
let conn = HttpsConnector::with_native_roots();
192+
let conn = HttpsConnectorBuilder::new()
193+
.with_native_roots()
194+
.https_or_http()
195+
.enable_http1()
196+
.enable_http2()
197+
.build();
198+
191199
self.build_with_conn(conn)
192200
}
193201

eventsource-client/src/event_parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ fn parse_field(line: &[u8]) -> Result<Option<(&str, &str)>> {
120120
}
121121

122122
fn parse_key(key: &[u8]) -> Result<&str> {
123-
from_utf8(key).map_err(|e| Error::InvalidLine(format!("malformed key: {:?}", e)))
123+
from_utf8(key).map_err(|e| Error::InvalidLine(format!("malformed key: {e:?}")))
124124
}
125125

126126
fn parse_value(value: &[u8]) -> Result<&str> {
127-
from_utf8(value).map_err(|e| Error::InvalidLine(format!("malformed value: {:?}", e)))
127+
from_utf8(value).map_err(|e| Error::InvalidLine(format!("malformed value: {e:?}")))
128128
}
129129

130130
#[pin_project]

0 commit comments

Comments
 (0)