diff mbox series

[bug#55030,v2,07/34] http-client: 'http-fetch/cached' converts strings to URIs.

Message ID ee055b3aedca9be03bce0e0e6723ea43ef249fc4.1652890702.git.philip@philipmcgrath.com
State Accepted
Headers show
Series gnu: elm: Update to 0.19.1. Add build system & importer. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Philip McGrath May 18, 2022, 6:10 p.m. UTC
* guix/http-client.scm (http-fetch/cached): Use 'string->uri' if URI is
a string, as with 'http-fetch'.
---
 guix/http-client.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

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 @@  (define* (http-fetch/cached uri #:key (ttl (%http-cache-ttl)) text?
 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