From 552db77fc72797e537803b1923a1e8dc96bc1b7a Mon Sep 17 00:00:00 2001 From: messense Date: Thu, 27 Jun 2019 23:28:54 +0800 Subject: [PATCH] Call req.path() on Json extractor error only --- src/types/json.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/types/json.rs b/src/types/json.rs index 0789fb612..92b865c05 100644 --- a/src/types/json.rs +++ b/src/types/json.rs @@ -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)