From af8208f33d206314166ee6bfc5338a5b30e3a2f2 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 3 Mar 2021 22:55:44 +0100 Subject: aws/request: Only process server response if it exists. --- aws/request.scm | 9 ++++++--- 1 file 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))))))) -- cgit v1.2.3