for request in request_paths:
logger.debug("request='%s'", request)
- http_url = f"http://{domain}{path}"
- https_url = f"https://{domain}{path}"
+ http_url = f"http://{domain}{str(path)}"
+ https_url = f"https://{domain}{str(path)}"
logger.debug("path[%s]='%s',request='%s',http_url='%s',https_url='%s'", type(path), path, request, http_url, https_url)
if path is None or path in [request, http_url, https_url]:
# HTTP headers for API requests
api_headers = {
- "User-Agent" : config.get("useragent"),
- "Content-Type": "application/json; charset=utf-8",
+ "User-Agent": config.get("useragent"),
+ "Accept" : "application/json; charset=utf-8",
}
# Exceptions to always catch
try:
logger.debug("Sending GET to domain='%s',path='%s',timeout(%d)='%s'", domain, path, len(timeout), timeout)
- response = fetch_response(domain, path, headers, timeout)
+ response = fetch_response(domain, path, {**api_headers, **headers}, timeout)
except exceptions as exception:
logger.debug("Fetching path='%s' from domain='%s' failed. exception[%s]='%s'", path, domain, type(exception), str(exception))
json_reply["status_code"] = 999