File tree Expand file tree Collapse file tree
crates/rmcp/src/transport/common Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -360,14 +360,7 @@ impl StreamableHttpClient for reqwest::Client {
360360 let body = response. bytes ( ) . await ?;
361361 match serde_json:: from_slice :: < ServerJsonRpcMessage > ( & body) {
362362 Ok ( parsed) => Ok ( StreamableHttpPostResponse :: Json ( parsed, session_id) ) ,
363- Err ( e)
364- if matches ! (
365- message,
366- ClientJsonRpcMessage :: Notification ( _)
367- | ClientJsonRpcMessage :: Response ( _)
368- | ClientJsonRpcMessage :: Error ( _)
369- ) =>
370- {
363+ Err ( e) if awaits_no_response => {
371364 tracing:: warn!(
372365 "could not parse JSON response as ServerJsonRpcMessage, treating as accepted: {e}"
373366 ) ;
@@ -385,7 +378,7 @@ impl StreamableHttpClient for reqwest::Client {
385378 // empty body, where an absent Content-Length stops the check above
386379 // from firing.
387380 _ if awaits_no_response => {
388- tracing:: debug !(
381+ tracing:: warn !(
389382 "ignoring unexpected content type {content_type:?} on a POST that awaits no response"
390383 ) ;
391384 Ok ( StreamableHttpPostResponse :: Accepted )
Original file line number Diff line number Diff line change @@ -325,14 +325,7 @@ impl StreamableHttpClient for UnixSocketHttpClient {
325325 . to_bytes ( ) ;
326326 match serde_json:: from_slice :: < ServerJsonRpcMessage > ( & body) {
327327 Ok ( parsed) => Ok ( StreamableHttpPostResponse :: Json ( parsed, session_id) ) ,
328- Err ( e)
329- if matches ! (
330- message,
331- ClientJsonRpcMessage :: Notification ( _)
332- | ClientJsonRpcMessage :: Response ( _)
333- | ClientJsonRpcMessage :: Error ( _)
334- ) =>
335- {
328+ Err ( e) if awaits_no_response => {
336329 tracing:: warn!(
337330 "could not parse JSON response as ServerJsonRpcMessage, treating as accepted: {e}"
338331 ) ;
@@ -347,7 +340,7 @@ impl StreamableHttpClient for UnixSocketHttpClient {
347340 // from the body, so accept any 2xx rather than failing the send on an
348341 // unexpected or absent Content-Type.
349342 _ if awaits_no_response => {
350- tracing:: debug !(
343+ tracing:: warn !(
351344 "ignoring unexpected content type {:?} on a POST that awaits no response" ,
352345 content_type
353346 ) ;
You can’t perform that action at this time.
0 commit comments