From ab0b3ef77d58c0348244cdc127d453545a8493e5 Mon Sep 17 00:00:00 2001 From: Benjamin Pelletier Date: Tue, 3 Oct 2023 17:09:11 +0000 Subject: [PATCH] Fix null json argument handling --- monitoring/monitorlib/fetch/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitoring/monitorlib/fetch/__init__.py b/monitoring/monitorlib/fetch/__init__.py index a9ced61b54..5a71144fe5 100644 --- a/monitoring/monitorlib/fetch/__init__.py +++ b/monitoring/monitorlib/fetch/__init__.py @@ -315,7 +315,7 @@ def query_and_describe( req_kwargs["timeout"] = TIMEOUTS # Attach a request_id field to the JSON body of any outgoing request with a JSON body that doesn't already have one - if "json" in req_kwargs and "request_id" not in req_kwargs["json"]: + if "json" in req_kwargs and isinstance(req_kwargs["json"], dict) and "request_id" not in req_kwargs["json"]: json_body = json.loads(json.dumps(req_kwargs["json"])) json_body["request_id"] = str(uuid.uuid4()) req_kwargs["json"] = json_body