From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 07 04:07:19 2022 Received: (at 53818) by debbugs.gnu.org; 7 Feb 2022 09:07:19 +0000 Received: from localhost ([127.0.0.1]:40920 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGzzF-0002sZ-10 for submit@debbugs.gnu.org; Mon, 07 Feb 2022 04:07:19 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:55276 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGzzD-0002ri-9A for 53818@debbugs.gnu.org; Mon, 07 Feb 2022 04:07:03 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644224817; bh=H8jADRyKH0fzq5VeA6Xl0rjl0GKGDAUsZO7ia0nN2ho=; h=From:To:Subject:In-Reply-To:References:Date; b=AkBgueNoH55EJP3JJBosf3/c8DZfwgdKy65vWi4gTiZggYkPOsg6mjsiQWHB9iD2f X4FLDz/u2vIiJXL9fSMK1j8jpIO3Tb3olEICxkBuPxuk7apPFq6W+JMZAT3/xFtSwE P4w2ruk50kgZZKDbiN6YQ61fMBlm7EUHjZ4bdFUc= To: 53818@debbugs.gnu.org Subject: [PATCH v2 3/7] http-client: 'http-fetch/cached' accepts a string or a . In-Reply-To: References: X-Debbugs-Cc: Maxime Devos Message-Id: <00f4de4c2fddf25566c726dde4a7d52ee80f7f71.1644224421.git.public@yoctocell.xyz> Date: Mon, 07 Feb 2022 10:06:57 +0100 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.5 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This is consistent with the 'http-fetch' procedure. * guix/http-client.scm (http-fetch/cached): The 'uri' argument can be a string or a record. --- guix/http-client.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Content analysis details: (2.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps X-Debbugs-Envelope-To: 53818 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.5 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This is consistent with the 'http-fetch' procedure. * guix/http-client.scm (http-fetch/cached): The 'uri' argument can be a string or a record. --- guix/http-client.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) Content analysis details: (1.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 T_SPF_HELO_TEMPERROR SPF: test of HELO record failed (temperror) -0.0 SPF_PASS SPF: sender matches SPF record 1.6 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: yoctocell.xyz (xyz)] 0.4 RDNS_DYNAMIC Delivered to internal network by host with dynamic-looking rDNS 0.5 FROM_SUSPICIOUS_NTLD From abused NTLD -0.0 T_SCC_BODY_TEXT_LINE No description available. -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 0.0 PDS_RDNS_DYNAMIC_FP RDNS_DYNAMIC with FP steps This is consistent with the 'http-fetch' procedure. * guix/http-client.scm (http-fetch/cached): The 'uri' argument can be a string or a 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