16 lines
358 B
Rust
16 lines
358 B
Rust
use http::Response;
|
|
use http_body_util::Full;
|
|
use hyper::body::Bytes;
|
|
use std::convert::Infallible;
|
|
|
|
pub struct Responder;
|
|
|
|
impl Responder {
|
|
pub fn unathorized() -> Result<Response<Full<Bytes>>, Infallible> {
|
|
Ok(Response::builder()
|
|
.status(401)
|
|
.body(Full::new(Bytes::from("Unauthorized")))
|
|
.unwrap())
|
|
}
|
|
}
|