mirror of https://github.com/fafhrd91/actix-web
Call req.path() on Json extractor error only
This commit is contained in:
parent
c0c71f82c0
commit
552db77fc7
|
@ -180,16 +180,14 @@ where
|
||||||
.map(|c| (c.limit, c.ehandler.clone(), c.content_type.clone()))
|
.map(|c| (c.limit, c.ehandler.clone(), c.content_type.clone()))
|
||||||
.unwrap_or((32768, None, None));
|
.unwrap_or((32768, None, None));
|
||||||
|
|
||||||
let path = req.path().to_string();
|
|
||||||
|
|
||||||
Box::new(
|
Box::new(
|
||||||
JsonBody::new(req, payload, ctype)
|
JsonBody::new(req, payload, ctype)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.map_err(move |e| {
|
.map_err(move |e| {
|
||||||
log::debug!(
|
log::debug!(
|
||||||
"Failed to deserialize Json from payload. \
|
"Failed to deserialize Json from payload. \
|
||||||
Request path: {:?}",
|
Request path: {}",
|
||||||
path
|
req2.path()
|
||||||
);
|
);
|
||||||
if let Some(err) = err {
|
if let Some(err) = err {
|
||||||
(*err)(e, &req2)
|
(*err)(e, &req2)
|
||||||
|
|
Loading…
Reference in New Issue