summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/publish.scm15
1 files changed, 11 insertions, 4 deletions
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index efaa549676..8da75cb825 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -300,10 +300,15 @@ References: ~a~%~a"
(canonical-sexp->string (signed-string info)))))
(format #f "~aSignature: 1;~a;~a~%" info (gethostname) signature)))
-(define (not-found request)
+(define* (not-found request
+ #:key (phrase "Resource not found")
+ ttl)
"Render 404 response for REQUEST."
- (values (build-response #:code 404)
- (string-append "Resource not found: "
+ (values (build-response #:code 404
+ #:headers (if ttl
+ `((cache-control (max-age . ,ttl)))
+ '()))
+ (string-append phrase ": "
(uri-path (request-uri request)))))
(define (render-nix-cache-info)
@@ -434,7 +439,9 @@ requested using POOL."
(file-expiration-time ttl)
#:delete-entry delete-entry
#:cleanup-period ttl))))
- (not-found request))
+ (not-found request
+ #:phrase "We're baking it"
+ #:ttl 300)) ;should be available within 5m
(else
(not-found request)))))