Skip to content

Commit 0609b8d

Browse files
committed
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.
1 parent b35cca7 commit 0609b8d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/groundlight/internalapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def call_api(self, *args, **kwargs):
176176
# Note we don't look for header_param in kwargs here, because this method is only called in one place
177177
# in the generated code, so we can afford to make this brittle.
178178
header_param = args[4] # that's the number in the list
179-
if not header_param:
179+
if header_param is None:
180180
# This will never happen in normal usage.
181181
logger.warning("Can't set request-id because headers not set")
182182
elif not header_param.get(self.REQUEST_ID_HEADER, None):

0 commit comments

Comments
 (0)