Skip to content

Commit 4ea231a

Browse files
committed
fix: add reqwest dependency to transport-streamable-http-client feature
- Fix compilation error when using transport-streamable-http-client feature due to missing dependency - Move From<reqwest::Error> implementation to reqwest module
1 parent 05e9a04 commit 4ea231a

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

crates/rmcp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ transport-worker = ["dep:tokio-stream"]
107107

108108

109109
# Streamable HTTP client
110-
transport-streamable-http-client = ["client-side-sse", "transport-worker"]
110+
transport-streamable-http-client = ["client-side-sse", "transport-worker", "reqwest"]
111111

112112

113113
transport-async-rw = ["tokio/io-util", "tokio-util/codec"]

crates/rmcp/src/transport/common/reqwest/streamable_http_client.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ use crate::{
1414
},
1515
};
1616

17+
impl From<reqwest::Error> for StreamableHttpError<reqwest::Error> {
18+
fn from(e: reqwest::Error) -> Self {
19+
StreamableHttpError::Client(e)
20+
}
21+
}
22+
1723
impl StreamableHttpClient for reqwest::Client {
1824
type Error = reqwest::Error;
1925

crates/rmcp/src/transport/streamable_http_client.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ pub enum StreamableHttpError<E: std::error::Error + Send + Sync + 'static> {
4848
Auth(#[from] crate::transport::auth::AuthError),
4949
}
5050

51-
impl From<reqwest::Error> for StreamableHttpError<reqwest::Error> {
52-
fn from(e: reqwest::Error) -> Self {
53-
StreamableHttpError::Client(e)
54-
}
55-
}
5651

5752
pub enum StreamableHttpPostResponse {
5853
Accepted,

0 commit comments

Comments
 (0)