1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-01 01:16:59 +02:00

non-blocking processing for NamedFile

This commit is contained in:
Nikolay Kim
2018-03-07 17:40:13 -08:00
parent af8875f6ab
commit 42d2a29b1d
5 changed files with 108 additions and 22 deletions

View File

@@ -26,8 +26,12 @@ pub trait HttpMessage {
#[doc(hidden)]
/// Get a header
fn get_header<H: Header>(&self) -> Result<H, ParseError> where Self: Sized {
H::parse(self)
fn get_header<H: Header>(&self) -> Option<H> where Self: Sized {
if self.headers().contains_key(H::name()) {
H::parse(self).ok()
} else {
None
}
}
/// Read the request content type. If request does not contain