lib/api_auth/headers.rb in api-auth-2.4.1 vs lib/api_auth/headers.rb in api-auth-2.5.0
- old
+ new
@@ -59,11 +59,11 @@
headers = @request.fetch_headers
canonical_array = [request_method.upcase,
@request.content_type,
- @request.content_md5,
+ @request.content_hash,
parse_uri(@request.original_uri || @request.request_uri),
@request.timestamp]
if headers_to_sign.is_a?(Array) && headers_to_sign.any?
headers_to_sign.each { |h| canonical_array << headers[h] if headers[h].present? }
@@ -79,18 +79,18 @@
def set_date
@request.set_date if @request.timestamp.nil?
end
- def calculate_md5
- @request.populate_content_md5 if @request.content_md5.nil?
+ def calculate_hash
+ @request.populate_content_hash if @request.content_hash.nil?
end
- def md5_mismatch?
- if @request.content_md5.nil?
+ def content_hash_mismatch?
+ if @request.content_hash.nil?
false
else
- @request.md5_mismatch?
+ @request.content_hash_mismatch?
end
end
# Sets the request's authorization header with the passed in value.
# The header should be the ApiAuth HMAC signature.