Skip to content

Commit

Permalink
Fixed v2 signer.
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorrowe committed Jun 5, 2015
1 parent 8db6b36 commit 1aa6b93
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions aws-sdk-core/lib/aws-sdk-core/signers/v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ def signature(http_request, params)
def string_to_sign(http_request, params)
[
http_request.http_method,
host(http_request),
http_request.endpoint.path,
host(http_request.endpoint),
path(http_request.endpoint),
params.to_s,
].join("\n")
end

def host(http_request)
endpoint = http_request.endpoint
def host(endpoint)
host = endpoint.host.downcase
if
(endpoint.scheme == 'http' && endpoint.port != 80) ||
Expand All @@ -43,6 +42,10 @@ def host(http_request)
host
end

def path(endpoint)
endpoint.path == '' ? '/' : endpoint.path
end

end
end
end

0 comments on commit 1aa6b93

Please sign in to comment.