mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-05-04 19:29:09 -07:00
server: api doc part 5
This commit is contained in:
@@ -11,6 +11,7 @@ where
|
||||
Self: Sized,
|
||||
{
|
||||
fn new_not_modified() -> Self;
|
||||
fn new_json_from_bytes(bytes: Vec<u8>) -> Self;
|
||||
}
|
||||
|
||||
impl ResponseExtended for Response<Body> {
|
||||
@@ -20,4 +21,11 @@ impl ResponseExtended for Response<Body> {
|
||||
headers.insert_cors();
|
||||
response
|
||||
}
|
||||
|
||||
fn new_json_from_bytes(bytes: Vec<u8>) -> Self {
|
||||
Response::builder()
|
||||
.header("content-type", "application/json")
|
||||
.body(bytes.into())
|
||||
.unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user