Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion datadog_lambda/asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from copy import deepcopy
from typing import Any, Dict, List, Optional, Union

from ddtrace.appsec._utils import Block_config
from ddtrace.contrib.internal.trace_utils import _get_request_header_client_ip
from ddtrace.internal import core
from ddtrace.internal.utils import get_blocked
Expand Down Expand Up @@ -223,7 +224,10 @@ def get_asm_blocked_response(
content = ""
else:
content_type = blocked.get("content-type", "application/json")
content = http_utils._get_blocked_template(content_type)
blocked_config = Block_config()
content = http_utils._get_blocked_template(
content_type, blocked_config.block_id
)
Comment thread
christophe-papazian marked this conversation as resolved.
Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really should have a test. Something to confirm that we're passing the correct values to the _get_blocked_template method.


response = {
"statusCode": blocked.get("status_code", 403),
Expand Down
Loading