From 5db5dff53d255eb0738de4b44717a4b148fb8294 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 11 May 2017 10:24:49 +0200 Subject: [PATCH] substitute: Honor 'Cache-Control' on 404 responses. * guix/scripts/substitute.scm (cached-narinfo): When VALUE is #f, use the TTL that is read instead of %NARINFO-NEGATIVE-TTL. (cached-narinfo-expiration-time): Likewise. --- guix/scripts/substitute.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 53162b3f9..73d4f6e2e 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -472,9 +472,9 @@ for PATH." (match (read p) (('narinfo ('version 2) ('cache-uri cache-uri) - ('date date) ('ttl _) ('value #f)) + ('date date) ('ttl ttl) ('value #f)) ;; A cached negative lookup. - (if (obsolete? date now %narinfo-negative-ttl) + (if (obsolete? date now ttl) (values #f #f) (values #t #f))) (('narinfo ('version 2) @@ -722,7 +722,7 @@ was found." (match (read port) (('narinfo ('version 2) ('cache-uri uri) ('date date) ('ttl ttl) ('value #f)) - (+ date %narinfo-negative-ttl)) + (+ date ttl)) (('narinfo ('version 2) ('cache-uri uri) ('date date) ('ttl ttl) ('value value)) (+ date ttl)) -- 2.11.4.GIT