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>
This commit is contained in:
Philip McGrath 2022-05-18 14:10:54 -04:00 committed by Ludovic Courtès
parent 00a5a07bb2
commit ae533e3084
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -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