Skip to content

Commit

Permalink
lib/aws.ml: cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Rochel committed Apr 16, 2021
1 parent 053029d commit 05e733a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/aws.ml
Original file line number Diff line number Diff line change
Expand Up @@ -530,24 +530,24 @@ module Signing = struct
let canonical_querystring = params in
let payload_hash = Hash.sha256_hex "" in
let canonical_headers =
"host:"
^ host
^ "\n"
^ "x-amz-content-sha256:"
^ payload_hash
^ "\nx-amz-date:"
^ amzdate
^ "\n"
[ "host", host
; "x-amz-content-sha256", payload_hash
; "x-amz-date", amzdate
]
in
let signed_headers = String.concat ";" (List.map fst canonical_headers) in
let canonical_headers_str =
let add_header acc (name, value) = acc ^ name ^ ":" ^ value ^ "\n" in
List.fold_left add_header "" canonical_headers
in
let signed_headers = "host;x-amz-content-sha256;x-amz-date" in
let canonical_request =
Request.string_of_meth meth
^ "\n"
^ canonical_uri
^ "\n"
^ canonical_querystring
^ "\n"
^ canonical_headers
^ canonical_headers_str
^ "\n"
^ signed_headers
^ "\n"
Expand Down

0 comments on commit 05e733a

Please sign in to comment.