summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilip McGrath <philip@philipmcgrath.com>2022-05-18 14:10:54 -0400
committerLudovic Courtès <ludo@gnu.org>2022-05-22 01:07:52 +0200
commitae533e3084b726188e78d1519f058e05c8388960 (patch)
treef1f4c0997cfb552595f3ef3921f2c7ff548efeae
parent00a5a07bb2af8b46169944ba772ad46d4e6e9172 (diff)
downloadguix-ae533e3084b726188e78d1519f058e05c8388960.tar.gz
http-client: 'http-fetch/cached' converts strings to URIs.
* guix/http-client.scm (http-fetch/cached): Use 'string->uri' if URI is
a string, as with 'http-fetch'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--guix/http-client.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/guix/http-client.scm b/guix/http-client.scm
index 699f5dfd57..9138a627ac 100644
--- a/guix/http-client.scm
+++ b/guix/http-client.scm
@@ -314,7 +314,10 @@ added automatically as appropriate.
 TIMEOUT specifies the timeout in seconds for connection establishment.
 
 Write information about redirects to LOG-PORT."
-  (let ((file (cache-file-for-uri uri)))
+  (let* ((uri (if (string? uri)
+                  (string->uri uri)
+                  uri))
+         (file (cache-file-for-uri uri)))
     (define (update-cache cache-port)
       (define cache-time
         (and cache-port