mirror of https://github.com/MISP/MISP
Fix to an invalid json request detection leading to the JSON export failing
- It seems like relying on the Accept header can lead to the data type detection failing when accessing .json extension views - this issue seems to have gone unnoticed since until now the data passed to the json view was the same as that passed to the html view - this means that all the additional UI only features may have triggered in the background previously on .json viewspull/762/head
parent
f36e00e944
commit
487912a15a
|
@ -236,7 +236,7 @@ class AppController extends Controller {
|
|||
|
||||
protected function _isJson($data=false){
|
||||
if ($data) return (json_decode($data) != NULL) ? true : false;
|
||||
return $this->request->header('Accept') === 'application/json';
|
||||
return $this->request->header('Accept') === 'application/json' || $this->RequestHandler->prefers() === 'json';
|
||||
}
|
||||
|
||||
//public function blackhole($type) {
|
||||
|
|
Loading…
Reference in New Issue