diff options
author | Ludovic Courtès <ludo@gnu.org> | 2021-05-05 11:34:20 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-05-05 23:44:48 +0200 |
commit | 626e61959089b9c7d1faa5dd6b15f8ed94f551fb (patch) | |
tree | 99e7179dc052e15a01a1e7aab541a06c272da4e3 | |
parent | 76c4646beb878e19a4cf1ca5789b699e597f27b0 (diff) | |
download | guix-626e61959089b9c7d1faa5dd6b15f8ed94f551fb.tar guix-626e61959089b9c7d1faa5dd6b15f8ed94f551fb.tar.gz |
swh: Adjust for compatibility with Guile 2.2's (web client).
Guile <= 2.2.7 did not support #:verify-certificate? so work around it.
* guix/swh.scm (http-get*, http-post*) [! guile-3]: Add variant for
Guile 2.2.
-rw-r--r-- | guix/swh.scm | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/guix/swh.scm b/guix/swh.scm index f11b7ea2d5..658bdedc66 100644 --- a/guix/swh.scm +++ b/guix/swh.scm @@ -147,12 +147,20 @@ url (string-append url "/"))) -;; XXX: Work around a bug in Guile 3.0.2 where #:verify-certificate? would -;; be ignored (<https://bugs.gnu.org/40486>). -(define* (http-get* uri #:rest rest) - (apply http-request uri #:method 'GET rest)) -(define* (http-post* uri #:rest rest) - (apply http-request uri #:method 'POST rest)) +(cond-expand + (guile-3 + ;; XXX: Work around a bug in Guile 3.0.2 where #:verify-certificate? would + ;; be ignored (<https://bugs.gnu.org/40486>). + (define* (http-get* uri #:rest rest) + (apply http-request uri #:method 'GET rest)) + (define* (http-post* uri #:rest rest) + (apply http-request uri #:method 'POST rest))) + (else ;Guile 2.2 + ;; Guile 2.2 did not have #:verify-certificate? so ignore it. + (define* (http-get* uri #:key verify-certificate? streaming?) + (http-request uri #:method 'GET #:streaming? streaming?)) + (define* (http-post* uri #:key verify-certificate? streaming?) + (http-request uri #:method 'POST #:streaming? streaming?)))) (define %date-regexp ;; Match strings like "2014-11-17T22:09:38+01:00" or |