summaryrefslogtreecommitdiff
path: root/lib/chef/http/http_request.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/http/http_request.rb')
-rw-r--r--lib/chef/http/http_request.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/chef/http/http_request.rb b/lib/chef/http/http_request.rb
index 1590537f19..f98e2bbbf0 100644
--- a/lib/chef/http/http_request.rb
+++ b/lib/chef/http/http_request.rb
@@ -37,7 +37,6 @@ require "chef/version"
class Chef
class HTTP
class HTTPRequest
-
engine = defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby"
UA_COMMON = "/#{::Chef::VERSION} (#{engine}-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}; ohai-#{Ohai::VERSION}; #{RUBY_PLATFORM}; +https://chef.io)"
@@ -72,7 +71,7 @@ class Chef
attr_reader :method, :url, :headers, :http_client, :http_request
- def initialize(method, url, req_body, base_headers={})
+ def initialize(method, url, req_body, base_headers = {})
@method, @url = method, url
@request_body = nil
build_headers(base_headers)
@@ -145,13 +144,12 @@ class Chef
# for the url scheme (80;443) - Fixes CHEF-5355
host_header = uri_safe_host.dup
host_header << ":#{port}" unless URI_SCHEME_DEFAULT_PORT[@url.scheme] == port.to_i
- @headers["Host"] = host_header unless @headers.keys.any? {|k| k.downcase.to_s == HOST_LOWER }
+ @headers["Host"] = host_header unless @headers.keys.any? { |k| k.downcase.to_s == HOST_LOWER }
@headers
end
-
- def configure_http_request(request_body=nil)
+ def configure_http_request(request_body = nil)
req_path = "#{path}"
req_path << "?#{query}" if query
@@ -181,7 +179,6 @@ class Chef
# Overwrite default UA
@http_request[USER_AGENT] = self.class.user_agent
end
-
end
end
end