Commit 64650e67 authored by Franziska Koehn's avatar Franziska Koehn
Browse files

deleting beginning and ending slashes from host-address

parent 0678c3b0
......@@ -94,7 +94,7 @@ def download(result, host, creds, rest, dest_folder='', cb=(lambda *_: None), cb
ret = re.sub('\{\w+\}', subfunc, rest)
path = os.path.join(dest_folder, '-'.join(names))
url = "%s%s" % (host, ret)
url = "%s%s" % (host.strip("/"), ret)
download_file(url, creds, path)
requests_lock.release()
......@@ -205,7 +205,7 @@ def query_for_additional_data(rest, result, host, creds):
return result[key]
ret = re.sub('\{\w+\}', subfunc, rest)
user, passw = creds
url = "%s%s" % (host, ret)
url = "%s%s" % (host.strip("/"), ret)
r = requests.get(url, auth=HTTPBasicAuth(user, passw))
exp = ElementTree.fromstring(r.text)
......@@ -245,7 +245,7 @@ def search_for(host, root_element, constraints, search_fields, user, passw):
from xsa.jsonutil import JsonTable
import json
url= "%s%s" % (host, "/data/search?format=json")
url = "%s%s" % (host.strip("/"), "/data/search?format=json")
with NamedTemporaryFile(suffix=".xml") as tmp:
tree = create_xml_tree(root_element, constraints, search_fields)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment