Return 410 Gone (rather than 500) if an output is no longer available

This commit is contained in:
Eelco Dolstra
2014-02-26 11:38:02 +01:00
parent 6327edd63f
commit 66b8c1a9e0
4 changed files with 11 additions and 10 deletions

View File

@ -84,10 +84,8 @@ sub pkg : Chained('nix') PathPart Args(1) {
|| notFound($c, "No such package in this channel.");
}
unless (all { isValidPath($_->path) } $c->stash->{build}->buildoutputs->all) {
$c->response->status(410); # "Gone"
error($c, "Build " . $c->stash->{build}->id . " is no longer available.");
}
gone($c, "Build " . $c->stash->{build}->id . " is no longer available.")
unless all { isValidPath($_->path) } $c->stash->{build}->buildoutputs->all;
$c->stash->{manifestUri} = $c->uri_for($self->action_for("manifest"), $c->req->captures);