mirror of https://github.com/MISP/PyMISP
parent
56059a8516
commit
72382f7618
|
@ -774,8 +774,8 @@ class PyMISP(object):
|
||||||
if controller not in ['events', 'attributes']:
|
if controller not in ['events', 'attributes']:
|
||||||
raise Exception('Invalid controller. Can only be {}'.format(', '.join(['events', 'attributes'])))
|
raise Exception('Invalid controller. Can only be {}'.format(', '.join(['events', 'attributes'])))
|
||||||
url = urljoin(self.root_url, '{}/{}'.format(controller, path.lstrip('/')))
|
url = urljoin(self.root_url, '{}/{}'.format(controller, path.lstrip('/')))
|
||||||
logger.debug('URL: ', url)
|
logger.debug('URL: %s', url)
|
||||||
logger.debug('Query: ', query)
|
logger.debug('Query: %s', query)
|
||||||
|
|
||||||
if ASYNC_OK and isinstance(session, FuturesSession) and async_callback:
|
if ASYNC_OK and isinstance(session, FuturesSession) and async_callback:
|
||||||
response = session.post(url, data=json.dumps(query), background_callback=async_callback)
|
response = session.post(url, data=json.dumps(query), background_callback=async_callback)
|
||||||
|
@ -1468,7 +1468,7 @@ class PyMISP(object):
|
||||||
session = self.__prepare_session()
|
session = self.__prepare_session()
|
||||||
url = urljoin(self.root_url, "/events/stix/download/{}/{}/{}/{}/{}".format(
|
url = urljoin(self.root_url, "/events/stix/download/{}/{}/{}/{}/{}".format(
|
||||||
event_id, with_attachments, tags, from_date, to_date))
|
event_id, with_attachments, tags, from_date, to_date))
|
||||||
logger.debug("Getting STIX event from", url)
|
logger.debug("Getting STIX event from %s", url)
|
||||||
response = session.get(url)
|
response = session.get(url)
|
||||||
return self._check_response(response)
|
return self._check_response(response)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue