Skip to content

Commit b03bf16

Browse files
committed
Set additive context disposed
1 parent 6b8d61b commit b03bf16

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tracer/src/Datadog.Trace/AppSec/Coordinator/SecurityCoordinator.Core.cs

+6
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,19 @@ internal override int? StatusCode
170170
{
171171
get
172172
{
173+
if (IsAdditiveContextDisposed())
174+
{
175+
return null;
176+
}
177+
173178
try
174179
{
175180
return Context.Response.StatusCode;
176181
}
177182
catch (Exception e) when (e is NullReferenceException or ObjectDisposedException)
178183
{
179184
Log.Debug(e, "Exception while trying to access StatusCode of a Context.Response.");
185+
SetAdditiveContextDisposed(true);
180186
return null;
181187
}
182188
}

0 commit comments

Comments
 (0)