mirror of https://github.com/MISP/MISP
commit
062390ed83
|
@ -32,6 +32,10 @@ class HttpSocketResponseExtended extends HttpSocketResponse
|
|||
{
|
||||
parent::parseResponse($message);
|
||||
|
||||
if ($this->body === '') {
|
||||
return; // skip decoding body if is empty
|
||||
}
|
||||
|
||||
$contentEncoding = $this->getHeader('Content-Encoding');
|
||||
if ($contentEncoding === 'gzip' && function_exists('gzdecode')) {
|
||||
$this->body = gzdecode($this->body);
|
||||
|
|
|
@ -2727,26 +2727,26 @@ class AppModel extends Model
|
|||
|
||||
/**
|
||||
* @param array $server
|
||||
* @param string $model
|
||||
* @return array[]
|
||||
* @throws JsonException
|
||||
*/
|
||||
protected function setupSyncRequest(array $server, $model = 'Server')
|
||||
{
|
||||
$version = implode('.', $this->checkMISPVersion());
|
||||
$commit = $this->checkMIPSCommit();
|
||||
$request = array(
|
||||
'header' => array(
|
||||
'Authorization' => $server[$model]['authkey'],
|
||||
'Accept' => 'application/json',
|
||||
'Content-Type' => 'application/json',
|
||||
'MISP-version' => $version,
|
||||
'User-Agent' => 'MISP ' . $version . (empty($commit) ? '' : ' - #' . $commit),
|
||||
)
|
||||
);
|
||||
|
||||
$commit = $this->checkMIPSCommit();
|
||||
if ($commit) {
|
||||
$request['header']['commit'] = $commit;
|
||||
}
|
||||
$request['header']['User-Agent'] = 'MISP ' . $version . (empty($commit) ? '' : ' - #' . $commit);
|
||||
return $request;
|
||||
}
|
||||
|
||||
|
|
|
@ -4472,13 +4472,11 @@ class Event extends AppModel
|
|||
$elevatedUser = array(
|
||||
'Role' => array(
|
||||
'perm_site_admin' => 1,
|
||||
'perm_sync' => 1
|
||||
'perm_sync' => 1,
|
||||
'perm_audit' => 0,
|
||||
),
|
||||
'org_id' => $eventOrgcId['Event']['orgc_id']
|
||||
);
|
||||
$elevatedUser['Role']['perm_site_admin'] = 1;
|
||||
$elevatedUser['Role']['perm_sync'] = 1;
|
||||
$elevatedUser['Role']['perm_audit'] = 0;
|
||||
$event = $this->fetchEvent($elevatedUser, array('eventid' => $id, 'metadata' => 1));
|
||||
if (empty($event)) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue