From 5db5dff53d255eb0738de4b44717a4b148fb8294 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 11 May 2017 10:24:49 +0200 Subject: 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 53162b3f9a..73d4f6e2eb 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)) -- cgit v1.2.3