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()))
.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)