forked from lix-project/hydra
Validate build IDs
This commit is contained in:
parent
5a7efc0469
commit
3687c9c30b
|
@ -1,5 +1,6 @@
|
|||
package Hydra::Controller::Build;
|
||||
|
||||
use utf8;
|
||||
use strict;
|
||||
use warnings;
|
||||
use base 'Hydra::Base::Controller::NixChannel';
|
||||
|
@ -18,6 +19,8 @@ use Encode;
|
|||
sub buildChain :Chained('/') :PathPart('build') :CaptureArgs(1) {
|
||||
my ($self, $c, $id) = @_;
|
||||
|
||||
$id =~ /^[0-9]+$/ or error($c, "Invalid build ID ‘$id’.");
|
||||
|
||||
$c->stash->{id} = $id;
|
||||
|
||||
$c->stash->{build} = getBuild($c, $id);
|
||||
|
|
Loading…
Reference in a new issue