1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-24 16:02:59 +01:00

fix reading from socket

This commit is contained in:
Nikolay Kim 2018-04-29 20:34:59 -07:00
parent 9c1bda3eca
commit 91235ac816
2 changed files with 2 additions and 2 deletions

View File

@ -573,7 +573,7 @@ impl<S: 'static> Handler<S> for StaticFiles<S> {
} else { } else {
let relpath = match req.match_info() let relpath = match req.match_info()
.get("tail") .get("tail")
.map(|tail| PathBuf::from_param(tail)) .map(|tail| PathBuf::from_param(tail.trim_left_matches('/')))
{ {
Some(Ok(path)) => path, Some(Ok(path)) => path,
_ => return Ok(self.default.handle(req)), _ => return Ok(self.default.handle(req)),

View File

@ -388,7 +388,7 @@ where
} }
} }
Err(e) => { Err(e) => {
return e.kind() == io::ErrorKind::WouldBlock; return e.kind() != io::ErrorKind::WouldBlock;
} }
} }
} }