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
1 changed files with 2 additions and 4 deletions

View File

@ -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)