summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-08-10 17:59:31 +0200
committerRicardo Wurmus <rekado@elephly.net>2021-08-10 17:59:31 +0200
commit6c765e5e1d28d44413ed095885eb40e8d3d27ea5 (patch)
treece700424631bbc63196a88f2e1d2a70b4227da06
parent5f4f566b9602b4a477885e41677944a3ecb61941 (diff)
request: Sort headers.
This fixes authentication, which was broken by commit 5b53bf56761a765efb0012aa6f10d854d8dfa9eb. Sorry.
-rw-r--r--aws/request.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/aws/request.scm b/aws/request.scm
index 21cc51b..d82df4c 100644
--- a/aws/request.scm
+++ b/aws/request.scm
@@ -205,8 +205,11 @@ used for presigned URLs."
(amz-date (date->string now "~Y~m~dT~H~M~SZ"))
(date-stamp (date->string now "~Y~m~d"))
(headers
- (cons `(x-amz-date . ,amz-date)
- headers))
+ (sort (cons `(x-amz-date . ,amz-date)
+ headers)
+ (lambda (a b)
+ (string< (symbol->string (first a))
+ (symbol->string (first b))))))
(canonical-headers
;; Header names must be trimmed, lower-case, sorted in
;; code point order from low to high! Note: there must