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:
@@ -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
|
||||
|
Reference in New Issue
Block a user