1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2025-04-12 12:54:06 +00:00

Call req.path() on Json extractor error only

This commit is contained in:
messense 2019-06-27 23:28:54 +08:00
parent c0c71f82c0
commit 552db77fc7

View file

@ -180,16 +180,14 @@ where
.map(|c| (c.limit, c.ehandler.clone(), c.content_type.clone()))
.unwrap_or((32768, None, None));
let path = req.path().to_string();
Box::new(
JsonBody::new(req, payload, ctype)
.limit(limit)
.map_err(move |e| {
log::debug!(
"Failed to deserialize Json from payload. \
Request path: {:?}",
path
Request path: {}",
req2.path()
);
if let Some(err) = err {
(*err)(e, &req2)