guix-patches
[Top][All Lists]
Advanced

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

[bug#53818] [PATCH v2 3/7] http-client: 'http-fetch/cached' accepts a st


From: Xinglu Chen
Subject: [bug#53818] [PATCH v2 3/7] http-client: 'http-fetch/cached' accepts a string or a <uri>.
Date: Mon, 07 Feb 2022 10:06:57 +0100

This is consistent with the 'http-fetch' procedure.

* guix/http-client.scm (http-fetch/cached): The 'uri' argument can be a string
  or a <uri> record.
---
 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 058f09852f..08efdd5e47 100644
--- a/guix/http-client.scm
+++ b/guix/http-client.scm
@@ -297,7 +297,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.34.1








reply via email to

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