lib/fastly/client.rb in fastly-1.5.0 vs lib/fastly/client.rb in fastly-1.6.0
- old
+ new
@@ -117,10 +117,12 @@
fail Error, resp.body unless resp.kind_of?(Net::HTTPSuccess)
JSON.parse(resp.body)
end
def headers(extras={})
- headers = fully_authed? ? { 'Cookie' => cookie } : { 'Fastly-Key' => api_key }
+ headers = fully_authed? ? { 'Cookie' => cookie } : {}
+ headers['Fastly-Key'] = api_key if api_key
+
headers.merge('Content-Accept' => 'application/json', 'User-Agent' => "fastly-ruby-v#{Fastly::VERSION}").merge(extras.keep_if {|k,v| !v.nil? })
end
def make_params(params)
param_ary = params.map do |key, value|