Helper/Nix: constructRunCommandLogPath: return undef in case of an error
This allows us to give a web request to an invalid UUID a 404.
This commit is contained in:
@ -538,7 +538,7 @@ sub runcommandlog :Local :Args(1) {
|
||||
die if defined $tail && $tail !~ /^[0-9]+$/;
|
||||
|
||||
my $runlog = $c->model('DB')->resultset('RunCommandLogs')->find({ uuid => $uuid });
|
||||
my $logFile = constructRunCommandLogPath($runlog);
|
||||
my $logFile = constructRunCommandLogPath($runlog) or notFound($c, "RunCommandLog not found.");
|
||||
if (-f $logFile) {
|
||||
serveLogFile($c, $logFile, $tail);
|
||||
return;
|
||||
|
Reference in New Issue
Block a user