mirror of https://github.com/MISP/PyMISP
parent
c8989c2ab2
commit
4085e0faef
|
@ -3704,6 +3704,9 @@ class PyMISP:
|
||||||
if url[0] == '/':
|
if url[0] == '/':
|
||||||
# strip it: it will fail if MISP is in a sub directory
|
# strip it: it will fail if MISP is in a sub directory
|
||||||
url = url[1:]
|
url = url[1:]
|
||||||
|
# Cake PHP being an idiot, it doesn't accepts %20 (space) in the URL path,
|
||||||
|
# so we need to make it a + instead and hope for the best
|
||||||
|
url = url.replace(' ', '+')
|
||||||
url = urljoin(self.root_url, url)
|
url = urljoin(self.root_url, url)
|
||||||
if data == {} or isinstance(data, bytes):
|
if data == {} or isinstance(data, bytes):
|
||||||
d = data
|
d = data
|
||||||
|
@ -3721,6 +3724,7 @@ class PyMISP:
|
||||||
# CakePHP params in URL
|
# CakePHP params in URL
|
||||||
to_append_url = '/'.join([f'{k}:{v}' for k, v in kw_params.items()])
|
to_append_url = '/'.join([f'{k}:{v}' for k, v in kw_params.items()])
|
||||||
url = f'{url}/{to_append_url}'
|
url = f'{url}/{to_append_url}'
|
||||||
|
|
||||||
req = requests.Request(request_type, url, data=d, params=params)
|
req = requests.Request(request_type, url, data=d, params=params)
|
||||||
user_agent = f'PyMISP {__version__} - Python {".".join(str(x) for x in sys.version_info[:2])}'
|
user_agent = f'PyMISP {__version__} - Python {".".join(str(x) for x in sys.version_info[:2])}'
|
||||||
if self.tool:
|
if self.tool:
|
||||||
|
|
Loading…
Reference in New Issue