(status: StatusCode, message: &str)
| 435 | } |
| 436 | |
| 437 | fn html_response(status: StatusCode, message: &str) -> Response<Full<Bytes>> { |
| 438 | let body = format!( |
| 439 | "<!DOCTYPE html><html><body style=\"font-family:sans-serif;text-align:center;padding:40px\">\ |
| 440 | <h2>{message}</h2></body></html>" |
| 441 | ); |
| 442 | Response::builder() |
| 443 | .status(status) |
| 444 | .header("content-type", "text/html") |
| 445 | .body(Full::new(Bytes::from(body))) |
| 446 | .expect("response") |
| 447 | } |
| 448 | |
| 449 | #[cfg(test)] |
| 450 | mod tests { |
no outgoing calls
no test coverage detected