forked from lix-project/hydra
* When a store path has disappeared for some reason,
../nix/<storepath> should return a HTTP error. Otherwise, mirror-channel.pl will happily mirror the error page.
This commit is contained in:
parent
9b25d7b299
commit
a22946abe7
|
@ -83,7 +83,7 @@ sub nix : Chained('get_builds') PathPart('channel') CaptureArgs(1) {
|
|||
getChannelData($c, scalar($c->stash->{allBuilds}));
|
||||
}
|
||||
else {
|
||||
error($c, "Unknown channel `$channelName'.");
|
||||
notFound($c, "Unknown channel `$channelName'.");
|
||||
}
|
||||
};
|
||||
error($c, $@) if $@;
|
||||
|
|
|
@ -30,7 +30,10 @@ sub nar : Chained('nix') PathPart {
|
|||
|
||||
my $path .= "/" . join("/", @rest);
|
||||
|
||||
error($c, "Path " . $path . " is no longer available.") unless isValidPath($path);
|
||||
if (!isValidPath($path)) {
|
||||
$c->response->status(410); "Gone"
|
||||
error($c, "Path " . $path . " is no longer available.");
|
||||
}
|
||||
|
||||
# !!! check that $path is in the closure of $c->stash->{storePaths}.
|
||||
|
||||
|
|
Loading…
Reference in a new issue