mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-04-20 06:54:46 +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
|
@ -99,6 +99,7 @@ fn errorlog<E: Display>(e: E) {
|
|||
#[cfg(not(feature = "errorlog"))]
|
||||
fn errorlog<E>(_e: E) {}
|
||||
|
||||
#[allow(deprecated)]
|
||||
fn handle_error<E>(e: E) -> Pin<Box<dyn Future<Output = Result<Response, E::Err>> + Send>>
|
||||
where
|
||||
E: Display + IntoResponseError
|
||||
|
@ -160,6 +161,7 @@ mod test {
|
|||
struct MsgError;
|
||||
|
||||
#[test]
|
||||
#[allow(deprecated)]
|
||||
fn result_from_future() {
|
||||
let nc = NoContent::default();
|
||||
let res = block_on(nc.into_response()).unwrap();
|
||||
|
|
|
@ -92,6 +92,7 @@ where
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(deprecated)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use futures_executor::block_on;
|
||||
|
|
|
@ -131,6 +131,7 @@ mod test {
|
|||
use mime::TEXT_PLAIN;
|
||||
|
||||
#[test]
|
||||
#[allow(deprecated)]
|
||||
fn raw_response() {
|
||||
let msg = "Test";
|
||||
let raw = Raw::new(msg, TEXT_PLAIN);
|
||||
|
|
|
@ -49,6 +49,7 @@ where
|
|||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[allow(deprecated)]
|
||||
mod test {
|
||||
use super::*;
|
||||
use crate::result::OrAllTypes;
|
||||
|
|
|
@ -124,6 +124,7 @@ mod test {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[allow(deprecated)]
|
||||
fn success_always_successfull() {
|
||||
let success: Success<Msg> = Msg::default().into();
|
||||
let res = block_on(success.into_response()).expect("didn't expect error response");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue