~ruther/guix-local

5db5dff53d255eb0738de4b44717a4b148fb8294 — Ludovic Courtès 8 years ago 24b2172
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.
1 files changed, 3 insertions(+), 3 deletions(-)

M guix/scripts/substitute.scm
M guix/scripts/substitute.scm => guix/scripts/substitute.scm +3 -3
@@ 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))