fix: dict.get default is already None

This commit is contained in:
sinavir 2024-04-19 17:19:50 +02:00
parent ca878138a1
commit a6904ba370

View file

@ -15,7 +15,7 @@ def hydrate_http_probes(tree, excludes=[]):
sys.exit(1)
if (
probe.kwargs["type"] == MonitorType.KEYWORD
and probe.kwargs.get("keyword", None) is None
and probe.kwargs.get("keyword") is None
):
logger.debug(f"Hydrating {probe.name}")
if "url" not in probe.kwargs:
@ -26,8 +26,8 @@ def hydrate_http_probes(tree, excludes=[]):
sys.exit(1)
url = probe.kwargs["url"]
method = probe.kwargs["method"]
headers = probe.kwargs.get("headers", None)
body = probe.kwargs.get("body", None)
headers = probe.kwargs.get("headers")
body = probe.kwargs.get("body")
content = requests.request(method, url, headers=headers, data=body).text
m = re.search("<title>(.*?)</title>", content)
if m is None: