summaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-11-04 15:57:00 +0100
committerLudovic Courtès <ludo@gnu.org>2020-11-04 16:02:53 +0100
commit5e7cf66fb35780f930ad0bc5fe21ac330df4411d (patch)
treeb4604b178b43e29e136635333a7716579f02dbab /guix/scripts
parent95024494f31c3176bcd2238662e7b7868acc2882 (diff)
publish: Do not path the empty string to 'query-path-info'.
Fixes <https://bugs.gnu.org/44442>. Regression introduced in 2b2ab7796ac186d88060793b8873fc0e21462758. * guix/scripts/publish.scm (render-nar/cached): Do not call 'bypass-cache?' when ITEM is the empty string. * tests/publish.scm ("with cache, cache bypass, unmapped hash part"): New test.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/publish.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/guix/scripts/publish.scm b/guix/scripts/publish.scm
index 9706b52844..e8faf379e2 100644
--- a/guix/scripts/publish.scm
+++ b/guix/scripts/publish.scm
@@ -681,7 +681,8 @@ return it; otherwise, return 404. When TTL is true, use it as the
(item (and hash
(guard (c ((store-error? c) #f))
(hash-part->path store hash)))))
- (and item (bypass-cache? store item)))
+ (and item (not (string-null? item))
+ (bypass-cache? store item)))
;; Render STORE-ITEM live. We reach this because STORE-ITEM is
;; being baked but clients are already asking for it. Thus, we're
;; duplicating work, but doing so allows us to reduce delays.