summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-03-03 22:55:44 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-03-03 22:55:44 +0100
commitaf8208f33d206314166ee6bfc5338a5b30e3a2f2 (patch)
tree63614e36c41fcae7e23b35d539d64fd9e89db0c8
parent9d6e85e899800720fc6f86cc0e382cf66ca9d93f (diff)
aws/request: Only process server response if it exists.
-rw-r--r--aws/request.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/aws/request.scm b/aws/request.scm
index e8ade5c..f9662b8 100644
--- a/aws/request.scm
+++ b/aws/request.scm
@@ -336,11 +336,14 @@ corresponding value in INPUT."
(let ((server-text (match body
((? bytevector? bv)
(utf8->string bv))
- ((? string? s) s))))
+ ((? string? s) s)
+ (anything anything))))
(match (response-content-type response)
((or ('application/x-amz-json-1.1 . rest)
('application/json . rest))
- (json-string->scm server-text))
+ (or (and=> server-text json-string->scm)
+ #true))
(('text/xml . rest)
- (xml->sxml server-text))
+ (or (and=> server-text xml->sxml)
+ #true))
(_ server-text)))))))