Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps!: Bump dependencies #58

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- image: cimg/rust:1.63.0
- image: cimg/rust:1.67.0
steps:
- checkout
- run:
Expand Down
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ members = [
"contract-tests",
"eventsource-client"
]

resolver = "2"
9 changes: 4 additions & 5 deletions contract-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ futures = { version = "0.3.21" }
serde = { version = "1.0", features = ["derive"] }
eventsource-client = { path = "../eventsource-client" }
serde_json = { version = "1.0.39"}
actix = { version = "0.12.0"}
actix-web = { version = "4.0.0-beta.10"}
reqwest = { version = "0.11.6", default_features = false, features = ["json", "rustls-tls"] }
env_logger = { version = "0.7.1" }
actix = { version = "0.13.1"}
actix-web = { version = "4"}
reqwest = { version = "0.11.6", default-features = false, features = ["json", "rustls-tls"] }
env_logger = { version = "0.10.0" }
hyper = { version = "0.14.17", features = ["client", "http1", "tcp"] }
log = "0.4.6"

[[bin]]
name = "sse-test-api"

10 changes: 5 additions & 5 deletions eventsource-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ exclude = [
[dependencies]
futures = "0.3.21"
hyper = { version = "0.14.17", features = ["client", "http1", "tcp"] }
hyper-rustls = { version = "0.22.1", optional = true }
hyper-rustls = { version = "0.24.1", optional = true }
log = "0.4.6"
pin-project = "1.0.10"
tokio = { version = "1.17.0", features = ["time"] }
hyper-timeout = "0.4.1"
rand = "0.8.5"

[dev-dependencies]
env_logger = "0.7.1"
env_logger = "0.10.0"
maplit = "1.0.1"
simplelog = "0.5.3"
simplelog = "0.12.1"
tokio = { version = "1.2.0", features = ["macros", "rt-multi-thread"] }
test-case = "1.2.3"
test-case = "3.2.1"
proptest = "1.0.0"


[features]
default = ["rustls"]
rustls = ["hyper-rustls", "hyper/http2"]
rustls = ["hyper-rustls", "hyper-rustls/http2"]

[[example]]
name = "tail"
Expand Down
14 changes: 11 additions & 3 deletions eventsource-client/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ use hyper::{
service::Service,
Body, Request, StatusCode, Uri,
};
#[cfg(feature = "rustls")]
use hyper_rustls::HttpsConnector as RustlsConnector;
use log::{debug, info, trace, warn};
use pin_project::pin_project;
use std::{
Expand Down Expand Up @@ -41,6 +39,10 @@ use crate::event_parser::SSE;
use crate::retry::{BackoffRetry, RetryStrategy};
use std::error::Error as StdError;

#[cfg(feature = "rustls")]
use hyper_rustls::HttpsConnector as RustlsConnector;
#[cfg(feature = "rustls")]
pub use hyper_rustls::HttpsConnectorBuilder;
#[cfg(feature = "rustls")]
pub type HttpsConnector = RustlsConnector<HttpConnector>;

Expand Down Expand Up @@ -187,7 +189,13 @@ impl ClientBuilder {
#[cfg(feature = "rustls")]
/// Build with an HTTPS client connector, using the OS root certificate store.
pub fn build(self) -> impl Client {
let conn = HttpsConnector::with_native_roots();
let conn = HttpsConnectorBuilder::new()
.with_native_roots()
.https_or_http()
.enable_http1()
.enable_http2()
.build();

self.build_with_conn(conn)
}

Expand Down
4 changes: 2 additions & 2 deletions eventsource-client/src/event_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ fn parse_field(line: &[u8]) -> Result<Option<(&str, &str)>> {
}

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

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

#[pin_project]
Expand Down