1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-05-09 16:10:42 +00:00

Custom HTTP Headers

This commit is contained in:
msrd0 2021-02-27 15:40:34 +00:00
parent 28ae4dfdee
commit 31f92c07cd
18 changed files with 475 additions and 416 deletions

View file

@ -3,10 +3,7 @@ use crate::openapi::{
builder::{OpenapiBuilder, OpenapiInfo},
router::OpenapiRouter
};
use crate::{
result::{ResourceError, ResourceResult},
Endpoint, FromBody, Resource, Response
};
use crate::{response::ResourceError, Endpoint, FromBody, IntoResponse, Resource, Response};
#[cfg(feature = "cors")]
use gotham::router::route::matcher::AccessControlRequestMethodMatcher;
@ -90,7 +87,7 @@ fn response_from(res: Response, state: &State) -> gotham::hyper::Response<Body>
async fn endpoint_handler<E: Endpoint>(state: &mut State) -> Result<gotham::hyper::Response<Body>, HandlerError>
where
E: Endpoint,
<E::Output as ResourceResult>::Err: Into<HandlerError>
<E::Output as IntoResponse>::Err: Into<HandlerError>
{
trace!("entering endpoint_handler");
let placeholders = E::Placeholders::take_from(state);