mirror of https://github.com/MISP/MISP
chg: [API] GET requests on restsearch with no parameters are no longer allowed.
- warn the user of the use of GET queries with posted JSON bodiespull/6232/head
parent
158c9aea66
commit
242d25d5e4
|
@ -1242,6 +1242,9 @@ class AppController extends Controller
|
|||
);
|
||||
$exception = false;
|
||||
$filters = $this->_harvestParameters($filterData, $exception, $this->_legacyParams);
|
||||
if (empty($filters) && $this->request->is('get')) {
|
||||
throw new InvalidArgumentException(__('Restsearch queries using GET and no parameters are not allowed. If you have passed parameters via a JSON body, make sure you use POST requests.'));
|
||||
}
|
||||
if (empty($filters['returnFormat'])) {
|
||||
$filters['returnFormat'] = 'json';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue