Skip to content

Commit 47de256

Browse files
committed
fix(appsec): perform _after extractions on the blocking_response 
1 parent 9c93e47 commit 47de256

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

datadog_lambda/wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,6 @@ def __call__(self, event, context, **kwargs):
187187
raise
188188
finally:
189189
self._after(event, context)
190-
if self.blocking_response:
191-
return self.blocking_response
192190

193191
def _inject_authorizer_span_headers(self, request_id):
194192
reference_span = self.inferred_span if self.inferred_span else self.span
@@ -283,6 +281,8 @@ def _before(self, event, context):
283281

284282
def _after(self, event, context):
285283
try:
284+
if self.blocking_response:
285+
self.response = self.blocking_response
286286
status_code = extract_http_status_code_tag(self.trigger_tags, self.response)
287287
if status_code:
288288
self.trigger_tags["http.status_code"] = status_code

0 commit comments

Comments
 (0)