network insight / export, return empty file when parameters are missing. closes https://github.com/opnsense/core/issues/1454

This commit is contained in:
Ad Schellevis 2017-10-15 18:14:08 +02:00
parent 3e95dfa1d5
commit 2f426ba419

View File

@ -261,7 +261,7 @@ class NetworkinsightController extends ApiControllerBase
) {
$this->response->setRawHeader("Content-Type: application/octet-stream");
$this->response->setRawHeader("Content-Disposition: attachment; filename=".$provider.".csv");
if ($this->request->isGet()) {
if ($this->request->isGet() && $provider != null && $resolution != null ) {
$backend = new Backend();
$configd_cmd = "netflow aggregate export {$provider} {$from_date} {$to_date} {$resolution}";
$response = $backend->configdRun($configd_cmd);