100
101
102
103
104
105
106
107
108
109
110
111
112
|
# File 'lib/api_auth/railtie.rb', line 100
def request_with_auth(method, path, *arguments)
if use_hmac && hmac_access_id && hmac_secret_key
h = arguments.last
tmp = "Net::HTTP::#{method.to_s.capitalize}".constantize.new(path, h)
tmp.body = arguments[0] if arguments.length > 1
ApiAuth.sign!(tmp, hmac_access_id, hmac_secret_key, {:with_http_method => (sign_with_http_method || false)})
arguments.last['Content-MD5'] = tmp['Content-MD5'] if tmp['Content-MD5']
arguments.last['DATE'] = tmp['DATE']
arguments.last['Authorization'] = tmp['Authorization']
end
request_without_auth(method, path, *arguments)
end
|