mirror of https://github.com/MISP/MISP
fix: [STIX] STIX upload fixed for API use
parent
1aef957d5f
commit
c84ae1cdc4
|
@ -1996,7 +1996,7 @@ class EventsController extends AppController
|
|||
throw new UnauthorizedException(__('You do not have permission to do that.'));
|
||||
}
|
||||
if ($this->request->is('post')) {
|
||||
$original_file = !empty($this->data['Event']['original_file']) ? $this->data['Event']['stix']['name'] : None;
|
||||
$original_file = !empty($this->data['Event']['original_file']) ? $this->data['Event']['stix']['name'] : '';
|
||||
if ($this->_isRest()) {
|
||||
$randomFileName = $this->Event->generateRandomFileName();
|
||||
$tmpDir = APP . "files" . DS . "scripts" . DS . "tmp";
|
||||
|
@ -2009,7 +2009,7 @@ class EventsController extends AppController
|
|||
} elseif (is_numeric($result)) {
|
||||
$event = $this->Event->fetchEvent($this->Auth->user(), array('eventid' => $result));
|
||||
if (!empty($event)) {
|
||||
return $this->RestResponse->viewData($event[0], $this->response->type());
|
||||
return $this->RestResponse->viewData($event[0], 'json');
|
||||
} else {
|
||||
return $this->RestResponse->saveFailResponse('Events', 'upload_stix', false, 'Could not read saved event.', $this->response->type());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue