Skip to content

Commit d0a2c62

Browse files
authored
Merge pull request #208 from djgoku/feat/allow-option-to-disable-sign-request
feat: Allow option `sign_request?` to disable signing
2 parents 87e0e6f + 54ecd71 commit d0a2c62

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/aws/request.ex

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,15 @@ defmodule AWS.Request do
121121

122122
headers = add_headers(additional_headers, headers)
123123

124-
headers = Signature.sign_v4(client, now(), http_method, url, headers, payload)
124+
{sign_request?, options} = Keyword.pop(options, :sign_request?, true)
125+
# Most requests require signatures, but this option allows it to
126+
# be disabled.
127+
headers =
128+
if sign_request? do
129+
Signature.sign_v4(client, now(), http_method, url, headers, payload)
130+
else
131+
headers
132+
end
125133

126134
{response_header_parameters, options} = Keyword.pop(options, :response_header_parameters)
127135

0 commit comments

Comments
 (0)