fix: [API] allow other returnFormats besides download to work for restsearch

pull/3551/head
iglocska 2018-08-09 16:26:12 +02:00
parent e2a268aea7
commit 4c604636d4
2 changed files with 2 additions and 2 deletions

View File

@ -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) {

View File

@ -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 {