fix: inject part into extension when handing init req (#275)
This commit is contained in:
parent
a62c6d1db8
commit
6d3190504c
1 changed files with 22 additions and 3 deletions
|
|
@ -103,6 +103,15 @@ pub(crate) const fn internal_error_response<E: Display>(
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn unexpected_message_response(
|
||||
expect: &str,
|
||||
) -> Response<UnsyncBoxBody<Bytes, Infallible>> {
|
||||
Response::builder()
|
||||
.status(http::StatusCode::UNPROCESSABLE_ENTITY)
|
||||
.body(Full::new(Bytes::from(format!("Unexpected message, expect {expect}"))).boxed_unsync())
|
||||
.expect("valid response")
|
||||
}
|
||||
|
||||
pub(crate) async fn expect_json<B>(
|
||||
body: B,
|
||||
) -> Result<ClientJsonRpcMessage, Response<UnsyncBoxBody<Bytes, Infallible>>>
|
||||
|
|
|
|||
Loading…
Reference in a new issue