Skip to content

Commit 5f35c0d

Browse files
committed
fix: use prefix to check mime type
1 parent cfd9869 commit 5f35c0d

File tree

1 file changed

+2
-2
lines changed
  • crates/rmcp/src/transport

1 file changed

+2
-2
lines changed

crates/rmcp/src/transport/sse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ impl SseClient<reqwest::Error> for ReqwestSseClient {
153153
let response = response.error_for_status()?;
154154
match response.headers().get(reqwest::header::CONTENT_TYPE) {
155155
Some(ct) => {
156-
if ct.as_bytes() != MIME_TYPE.as_bytes() {
156+
if !ct.as_bytes().starts_with(MIME_TYPE.as_bytes()) {
157157
return Err(SseTransportError::UnexpectedContentType(Some(ct.clone())));
158158
}
159159
}
@@ -190,7 +190,7 @@ impl SseClient<reqwest::Error> for ReqwestSseClient {
190190

191191
/// # Transport for client sse
192192
///
193-
/// Call [`SseTransport::start`] to create a new transport from url.
193+
/// Call [`SseTransport::start`] to create a new transport from url.
194194
///
195195
/// Call [`SseTransport::start_with_client`] to create a new transport with a customized reqwest client.
196196
pub struct SseTransport<C: SseClient<E>, E: std::error::Error + Send + Sync + 'static> {

0 commit comments

Comments
 (0)