Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[handler] fix regression in api_request for Ruby >= 2.0
Comparing the arguments for `Net::HTTPGenericRequest` on [1.9.1](https://ruby-doc.org/stdlib-1.9.1/libdoc/net/http/rdoc/Net/HTTPGenericRequest.html) vs [2.3.0](https://ruby-doc.org/stdlib-2.3.0/libdoc/net/http/rdoc/Net/HTTPGenericRequest.html), I see that 1.9.1 expects argument `path` where as 2.3.0 takes `uri_or_path` argument. If the `uri_or_path` is not a `URI` object, it is treated as the path. I believe we can unconditionally pass the value of `uri.path` to `net_http_req_class(method).new` on both ruby 1.9 and 2.x, as the hostname, port and scheme are explicitly set when calling `Net::HTTP.start`. Closes sensu-plugins/sensu-plugins-sensu#18 Closes #160 Closes #161
- Loading branch information