mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-04-20 23:07:01 +00:00
add headers to the response (#27)
This commit is contained in:
parent
3600a115d0
commit
44f3c9fe84
9 changed files with 48 additions and 12 deletions
|
@ -196,11 +196,11 @@ impl ErrorVariant {
|
|||
quote!(#from_field.into_response_error())
|
||||
},
|
||||
(Some(_), Some(_)) => return Err(Error::new(ident.span(), "When #[from] is used, #[status] must not be used!")),
|
||||
(None, Some(status)) => quote!(Ok(#krate::Response {
|
||||
status: { #status }.into(),
|
||||
body: #krate::gotham::hyper::Body::empty(),
|
||||
mime: None
|
||||
})),
|
||||
(None, Some(status)) => quote!(Ok(#krate::Response::new(
|
||||
{ #status }.into(),
|
||||
#krate::gotham::hyper::Body::empty(),
|
||||
None
|
||||
))),
|
||||
(None, None) => return Err(Error::new(ident.span(), "Missing #[status(code)] for this variant"))
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue