summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-03-02 16:33:45 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2017-03-02 16:33:45 -0800
commitd4caa2d16f7a448a83947ac975bf900f55e4c261 (patch)
tree213480b0f1b828004ffa605dc43954ce34ec6e62
parentf874267c1e8596f61e49a87e91effc4e8181145c (diff)
downloadchef-d4caa2d16f7a448a83947ac975bf900f55e4c261.tar.gz
truncate long response bodies in debug output
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/http/json_output.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/http/json_output.rb b/lib/chef/http/json_output.rb
index 180f9edf65..179f1de4ef 100644
--- a/lib/chef/http/json_output.rb
+++ b/lib/chef/http/json_output.rb
@@ -61,7 +61,7 @@ class Chef
[http_response, rest_request, return_value]
else
Chef::Log.debug("Expected JSON response, but got content-type '#{http_response['content-type']}'")
- Chef::Log.debug("Response body contains:\n#{http_response.body}")
+ Chef::Log.debug("Response body contains:\n#{http_response.body.length < 256 ? http_response.body : http_response.body[0..256] + " [...truncated...]"}")
return [http_response, rest_request, http_response.body.to_s]
end
end