mirror of https://github.com/MISP/MISP
fix: [API] allow other returnFormats besides download to work for restsearch
parent
e2a268aea7
commit
4c604636d4
|
@ -536,7 +536,7 @@ class AppController extends Controller
|
|||
}
|
||||
|
||||
protected function _getApiAuthUser($key, &$exception) {
|
||||
if ($key != 'download') {
|
||||
if (strlen($key) == 40) {
|
||||
// check if the key is valid -> search for users based on key
|
||||
$user = $this->checkAuthUser($key);
|
||||
if (!$user) {
|
||||
|
|
|
@ -3065,7 +3065,7 @@ class EventsController extends AppController
|
|||
'openioc' => 'IOCExportTool'
|
||||
);
|
||||
if (in_array($returnFormat, array('json', 'xml', 'openioc'))) {
|
||||
$responseType = $key;
|
||||
$responseType = $returnFormat;
|
||||
} elseif (((isset($this->request->params['ext']) && $this->request->params['ext'] == 'xml')) || $this->response->type() == 'application/xml') {
|
||||
$responseType = 'xml';
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue