summaryrefslogtreecommitdiff
path: root/lib/chef/client.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/client.rb')
-rw-r--r--lib/chef/client.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/chef/client.rb b/lib/chef/client.rb
index 3c86f52b4a..3aad0c9f80 100644
--- a/lib/chef/client.rb
+++ b/lib/chef/client.rb
@@ -381,13 +381,25 @@ class Chef
end
end
+ #
# Resource reporters send event information back to the chef server for
- # processing. Can only be called after we have a @rest object
+ # processing
+ #
# @api private
+ #
def register_reporters
+ # Audit and Resource Reporters set validate_utf8 to false so that they
+ # never fail if we accidentally send binary data through (validate_utf8
+ # will raise when set to true, and sanitizes to utf8 when false)
+ reporter_rest = Chef::REST.new(
+ config[:chef_server_url],
+ client_name,
+ config[:client_key],
+ validate_utf8: false,
+ )
[
- Chef::ResourceReporter.new(rest),
- Chef::Audit::AuditReporter.new(rest)
+ Chef::ResourceReporter.new(reporter_rest),
+ Chef::Audit::AuditReporter.new(reporter_rest)
].each do |r|
events.register(r)
end