Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoEchevarria committed Sep 13, 2024
1 parent 336f692 commit 76cef2f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,16 @@ internal override bool IsBlocked

internal override bool ReportedExternalWafsRequestHeaders
{
get => Context.Items["ReportedExternalWafsRequestHeaders"] is true;
set => Context.Items["ReportedExternalWafsRequestHeaders"] = value;
get
{
if (Context.Items.TryGetValue(ReportedExternalWafsRequestHeaders, out var value))
{
return value is bool boolValue && boolValue;
}

return false;
}
set => Context.Items[ReportedExternalWafsRequestHeaders] = value;
}

internal override void MarkBlocked() => Context.Items[BlockingAction.BlockDefaultActionName] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,8 +536,8 @@ public HttpTransport(HttpContext context)

internal override bool ReportedExternalWafsRequestHeaders
{
get => Context.Items["ReportedExternalWafsRequestHeaders"] is true;
set => Context.Items["ReportedExternalWafsRequestHeaders"] = value;
get => Context.Items[ReportedExternalWafsRequestHeaders] is true;
set => Context.Items[ReportedExternalWafsRequestHeaders] = value;
}

internal override void MarkBlocked() => Context.Items[BlockingAction.BlockDefaultActionName] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace Datadog.Trace.AppSec.Coordinator;
/// </summary>
internal readonly partial struct SecurityCoordinator
{
private const string ReportedExternalWafsRequestHeaders = "ReportedExternalWafsRequestHeaders";
private static readonly IDatadogLogger Log = DatadogLogging.GetLoggerFor<SecurityCoordinator>();
private readonly Security _security;
private readonly Span _localRootSpan;
Expand Down

0 comments on commit 76cef2f

Please sign in to comment.