[bug#53818,v2,3/7] http-client: 'http-fetch/cached' accepts a string or a <uri>.
Commit Message
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(-)
@@ -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