diff --git a/nixbld-etc-nixos/hydra-binary-cache-store.patch b/nixbld-etc-nixos/hydra-binary-cache-store.patch index 1570e5b..a66ba66 100644 --- a/nixbld-etc-nixos/hydra-binary-cache-store.patch +++ b/nixbld-etc-nixos/hydra-binary-cache-store.patch @@ -222,3 +222,30 @@ index 4276f95a..21ff8a97 100644 -- 2.29.0 +From e20013bff3c92b21bab6e476489a1508df1cf348 Mon Sep 17 00:00:00 2001 +From: Astro +Date: Mon, 22 Feb 2021 00:12:12 +0100 +Subject: [PATCH] check if nar not found + +--- + src/lib/Hydra/Controller/Root.pm | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm +index 6be9f2bc..37464c34 100644 +--- a/src/lib/Hydra/Controller/Root.pm ++++ b/src/lib/Hydra/Controller/Root.pm +@@ -326,6 +326,10 @@ sub nar :Local :Args(1) { + $c->response->content_type('application/x-nix-archive'); + + $path = "/" . $1 . "/nar/$path"; ++ if (!-f $path) { ++ return notFound($c, "NAR not found"); ++ } ++ + my $fh = new IO::Handle; + open $fh, "<:raw", $path; + $c->response->body($fh); +-- +2.30.0 +