Skip to content

Commit

Permalink
Fix null json argument handling
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminPelletier committed Oct 3, 2023
1 parent db3d82d commit ab0b3ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion monitoring/monitorlib/fetch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab0b3ef

Please sign in to comment.