diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-02 16:33:45 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-02 16:33:45 -0800 |
commit | d4caa2d16f7a448a83947ac975bf900f55e4c261 (patch) | |
tree | 213480b0f1b828004ffa605dc43954ce34ec6e62 | |
parent | f874267c1e8596f61e49a87e91effc4e8181145c (diff) | |
download | chef-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.rb | 2 |
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 |