mirror of
https://github.com/actix/actix-web.git
synced 2025-04-10 11:54:06 +00:00
Cleanup len parse code
This commit is contained in:
parent
552db77fc7
commit
539e8c11ec
1 changed files with 5 additions and 8 deletions
|
@ -322,14 +322,11 @@ where
|
|||
};
|
||||
}
|
||||
|
||||
let mut len = None;
|
||||
if let Some(l) = req.headers().get(&CONTENT_LENGTH) {
|
||||
if let Ok(s) = l.to_str() {
|
||||
if let Ok(l) = s.parse::<usize>() {
|
||||
len = Some(l)
|
||||
}
|
||||
}
|
||||
}
|
||||
let len = req
|
||||
.headers()
|
||||
.get(&CONTENT_LENGTH)
|
||||
.and_then(|l| l.to_str().ok())
|
||||
.and_then(|s| s.parse::<usize>().ok());
|
||||
let payload = Decompress::from_headers(payload.take(), req.headers());
|
||||
|
||||
JsonBody {
|
||||
|
|
Loading…
Reference in a new issue