mirror of https://github.com/fafhrd91/actix-web
Cleanup len parse code
This commit is contained in:
parent
552db77fc7
commit
539e8c11ec
|
@ -322,14 +322,11 @@ where
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut len = None;
|
let len = req
|
||||||
if let Some(l) = req.headers().get(&CONTENT_LENGTH) {
|
.headers()
|
||||||
if let Ok(s) = l.to_str() {
|
.get(&CONTENT_LENGTH)
|
||||||
if let Ok(l) = s.parse::<usize>() {
|
.and_then(|l| l.to_str().ok())
|
||||||
len = Some(l)
|
.and_then(|s| s.parse::<usize>().ok());
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let payload = Decompress::from_headers(payload.take(), req.headers());
|
let payload = Decompress::from_headers(payload.take(), req.headers());
|
||||||
|
|
||||||
JsonBody {
|
JsonBody {
|
||||||
|
|
Loading…
Reference in New Issue