server: api doc part 5

This commit is contained in:
nym21
2025-10-08 20:32:27 +02:00
parent 83d74da556
commit 6ad15221de
11 changed files with 418 additions and 308 deletions

View File

@@ -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()
}
}