guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#55030] [PATCH v2 07/34] http-client: 'http-fetch/cached' converts s


From: Philip McGrath
Subject: [bug#55030] [PATCH v2 07/34] http-client: 'http-fetch/cached' converts strings to URIs.
Date: Wed, 18 May 2022 14:10:54 -0400

* 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 --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
-- 
2.32.0






reply via email to

[Prev in Thread] Current Thread [Next in Thread]