summaryrefslogtreecommitdiff
path: root/lib/chef/http/http_request.rb
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-02-04 08:35:04 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-02-04 08:35:04 -0800
commit938c37c2dd5bff3b888540ae1ae4d2e51b3208d8 (patch)
tree2ee587d74840857a1aaffc09692781d64ebd85ef /lib/chef/http/http_request.rb
parentdfeb0a2f8888ea8e1f1860e3da7ad7a1a4dac56f (diff)
downloadchef-lcg/whitespace-style.tar.gz
whitespace fixeslcg/whitespace-style
5533 Style/SpaceInsideHashLiteralBraces 2619 Style/SpaceAroundOperators 2288 Style/EmptyLinesAroundBlockBody 2012 Style/SpaceInsideBlockBraces 1444 Style/AlignHash 1395 Style/SpaceAfterComma 1382 Style/SpaceAroundEqualsInParameterDefault 800 Style/EmptyLinesAroundClassBody 396 Style/IndentationConsistency 354 Style/ExtraSpacing 310 Style/SpaceBeforeBlockBraces 309 Style/EmptyLines 304 Style/TrailingWhitespace 241 Style/MultilineOperationIndentation 230 Style/TrailingBlankLines 219 Style/EmptyLinesAroundModuleBody 212 Style/IndentHash 147 Style/IndentationWidth 120 Style/EmptyLineBetweenDefs 107 Style/SpaceAroundBlockParameters 63 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
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