diff --git a/CHANGELOG.md b/CHANGELOG.md index e13e3ee..1a1341c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +- Fixed a regression in Sensu::Handler `api_request` method, introduced in + v1.4.3, which broke silence stashes and check dependencies on Ruby 2.x. + ## [v1.4.3] - 2016-10-04 - Fixed an incompatibility with Ruby 1.9 introduced in Sensu::Handler api_request circa sensu-plugin 1.3.0 diff --git a/lib/sensu-handler.rb b/lib/sensu-handler.rb index 8b5d223..b8eec19 100644 --- a/lib/sensu-handler.rb +++ b/lib/sensu-handler.rb @@ -133,7 +133,7 @@ def api_request(method, path, &blk) end domain = api_settings['host'].start_with?('http') ? api_settings['host'] : 'http://' + api_settings['host'] uri = URI("#{domain}:#{api_settings['port']}#{path}") - req = net_http_req_class(method).new(uri.to_s) + req = net_http_req_class(method).new(uri.path) if api_settings['user'] && api_settings['password'] req.basic_auth(api_settings['user'], api_settings['password']) end