From 0609b8dff8834b53bd1ef2a77282fcb5610dea5f Mon Sep 17 00:00:00 2001 From: Brandon Date: Tue, 14 Apr 2026 18:26:28 +0000 Subject: [PATCH] Fix false warning on DELETE endpoints: "Can't set request-id because headers not set" The check `if not header_param:` incorrectly treats an empty dict {} as falsy, skipping X-Request-Id injection for every endpoint whose OpenAPI spec has empty accept and content_type headers. This affects all DELETE endpoints (delete_detector, delete_priming_group, delete_rule, reset_detector) and edge_report_metrics_create. The fix changes the guard to `if header_param is None:` so that an empty dict correctly falls through to the elif branch and gets the request-id header set. --- src/groundlight/internalapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/groundlight/internalapi.py b/src/groundlight/internalapi.py index 48e87cf6..40a7dffe 100644 --- a/src/groundlight/internalapi.py +++ b/src/groundlight/internalapi.py @@ -176,7 +176,7 @@ def call_api(self, *args, **kwargs): # Note we don't look for header_param in kwargs here, because this method is only called in one place # in the generated code, so we can afford to make this brittle. header_param = args[4] # that's the number in the list - if not header_param: + if header_param is None: # This will never happen in normal usage. logger.warning("Can't set request-id because headers not set") elif not header_param.get(self.REQUEST_ID_HEADER, None):