diff options
Diffstat (limited to 'aws')
-rw-r--r-- | aws/request.scm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/aws/request.scm b/aws/request.scm index 5773398..abaabb7 100644 --- a/aws/request.scm +++ b/aws/request.scm @@ -1,5 +1,5 @@ ;;; guile-aws --- Scheme DSL for the AWS APIs -;;; Copyright © 2019 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2019, 2020 Ricardo Wurmus <rekado@elephly.net> ;;; ;;; Guile-AWS is free software: you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published @@ -47,6 +47,18 @@ (define (hexify bv) (format #f "~{~2,'0x~}" (bytevector->u8-list bv))) +;; XXX: Guile's default-val-writer corrupts the Authorization header, +;; because it wraps the value of the SignedHeaders field in quotes. +;; This confuses AWS. +(define (my-default-val-writer k val port) + (if (or (string-index val #\,) + (string-index val #\")) + ((@@ (web http) write-qstring) val port) + ((@@ (web http) put-string) port val))) +(module-set! + (resolve-module '(web http)) + 'default-val-writer my-default-val-writer) + ;; See https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html (define* (serialize-aws-value thing #:key (path '()) n (depth 0)) |