Fix bug with parse_on_demand (take 2)
Tomas Doran [Wed, 25 Aug 2010 13:47:23 +0000 (13:47 +0000)]
Changes
lib/Catalyst.pm

diff --git a/Changes b/Changes
index 308a63a..36175c6 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,12 @@
 # This file documents the revision history for Perl extension Catalyst.
 
+ Bug fixes:
+  - parse_on_demand fixed when used in conjunction with debug mode.
+    A regression was introduced in 5.80022 which would cause the body
+    to always be parsed for logging at the end of the request when in
+    debug mode. This has been fixed so that if the body has not been parsed
+    by the time the request is logged, then the body is omitted.
+
 5.80025 2010-07-29 01:50:00
 
  New features:
index 07a8c16..e310bd8 100644 (file)
@@ -2150,7 +2150,7 @@ sub log_request {
         $c->log->debug("Query keywords are: $keywords");
     }
 
-    $c->log_request_parameters( query => $request->query_parameters, body => $request->body_parameters );
+    $c->log_request_parameters( query => $request->query_parameters, $request->_has_body ? (body => $request->body_parameters) : () );
 
     $c->log_request_uploads($request);
 }