mirror of https://github.com/MISP/MISP
fix: [API] using "download" as a returnformat via the URL breaks the restSearch API
- we have to keep it as a legacy option and map it to jsonpull/3626/head
parent
bcfc1f3a1a
commit
7e5be5f37b
|
@ -2112,6 +2112,9 @@ class AttributesController extends AppController
|
|||
if (isset($filters['returnFormat'])) {
|
||||
$returnFormat = $filters['returnFormat'];
|
||||
}
|
||||
if ($returnFormat === 'download') {
|
||||
$returnFormat = 'json';
|
||||
}
|
||||
$conditions = $this->Attribute->buildFilterConditions($this->Auth->user(), $filters);
|
||||
$params = array(
|
||||
'conditions' => $conditions,
|
||||
|
|
|
@ -3036,6 +3036,9 @@ class EventsController extends AppController
|
|||
if (isset($filters['returnFormat'])) {
|
||||
$returnFormat = $filters['returnFormat'];
|
||||
}
|
||||
if ($returnFormat === 'download') {
|
||||
$returnFormat = 'json';
|
||||
}
|
||||
$eventid = $this->Event->filterEventIds($user, $filters);
|
||||
if (!isset($validFormats[$returnFormat])) {
|
||||
// this is where the new code path for the export modules will go
|
||||
|
|
Loading…
Reference in New Issue