aws/request: make-operation->request: Define PAYLOAD-HASH.
authorRicardo Wurmus <rekado@elephly.net>
Tue, 7 Jul 2020 18:24:26 +0000 (20:24 +0200)
committerRicardo Wurmus <rekado@elephly.net>
Tue, 7 Jul 2020 18:24:26 +0000 (20:24 +0200)
* aws/request.scm (make-operation->request)[payload-hash]: New
variable definition.

aws/request.scm

index abaabb7127503ac4aa7e55c7f3c97760218a88c0..faa5e0dc8580196bcfeaa9043628685cb570d36d 100644 (file)
                           (serialize-aws-value input))
                    "&"))
 
+    (define payload-hash
+      (hexify (sha256 (string->utf8 request-parameters))))
+
     (define now (current-date 0))
     (define amz-date
       (date->string now "~Y~m~dT~H~M~SZ"))
                                  canonical-querystring
                                  canonical-headers
                                  signed-headers
-                                 ;; The payload hash
-                                 (hexify (sha256 (string->utf8 request-parameters))))
+                                 payload-hash)
                            "\n"))
              (credential-scope
               (string-join (list date-stamp