* 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:
Eelco Dolstra 2010-02-05 20:08:41 +00:00
parent 9b25d7b299
commit a22946abe7
2 changed files with 5 additions and 2 deletions

View file

@ -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 $@;

View file

@ -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}.