@@ -165,26 +165,26 @@ protected override void OnNext(string eventName, object arg)
165165
166166 private void OnHostingHttpRequestInStart ( object arg )
167167 {
168- var shouldTrace = _tracer . CurrentTraceSettings . Settings . IsIntegrationEnabled ( IntegrationId ) ;
169- var shouldSecure = _security . AppsecEnabled ;
168+ var integrationEnabled = _tracer . CurrentTraceSettings . Settings . IsIntegrationEnabled ( IntegrationId ) ;
169+ var appsecEnabled = _security . AppsecEnabled ;
170170
171- if ( ! shouldTrace && ! shouldSecure )
171+ if ( ! integrationEnabled && ! appsecEnabled )
172172 {
173173 return ;
174174 }
175175
176176 if ( arg . TryDuckCast < AspNetCoreDiagnosticObserver . HttpRequestInStartStruct > ( out var requestStruct ) )
177177 {
178178 var httpContext = requestStruct . HttpContext ;
179- if ( shouldTrace )
179+ if ( integrationEnabled )
180180 {
181181 // Use an empty resource name here, as we will likely replace it as part of the request
182182 // If we don't, update it in OnHostingHttpRequestInStop or OnHostingUnhandledException
183183 // If the app is using resource-based sampling rules, then we need to set a resource straight
184184 // away, so force that by using null.
185185 var resourceName = _tracer . CurrentTraceSettings . HasResourceBasedSamplingRule ? null : string . Empty ;
186186 var scope = AspNetCoreRequestHandler . StartAspNetCoreSingleSpanPipelineScope ( _tracer , _security , _iast , httpContext , resourceName ) ;
187- if ( shouldSecure )
187+ if ( appsecEnabled )
188188 {
189189 CoreHttpContextStore . Instance . Set ( httpContext ) ;
190190 var securityReporter = new SecurityReporter ( scope . Span , new SecurityCoordinator . HttpTransport ( httpContext ) ) ;
@@ -315,11 +315,11 @@ private void OnRoutingEndpointMatched(object arg)
315315
316316 private void OnMvcBeforeAction ( object arg )
317317 {
318- var shouldSecure = _security . AppsecEnabled ;
319- var shouldUseIast = _iast . Settings . Enabled ;
318+ var appsecEnabled = _security . AppsecEnabled ;
319+ var iastEnabled = _iast . Settings . Enabled ;
320320 var isCodeOriginEnabled = CurrentCodeOrigin is { Settings . CodeOriginForSpansEnabled : true } ;
321321
322- if ( ! shouldSecure && ! shouldUseIast && ! isCodeOriginEnabled )
322+ if ( ! appsecEnabled && ! iastEnabled && ! isCodeOriginEnabled )
323323 {
324324 return ;
325325 }
@@ -342,7 +342,7 @@ private void OnMvcBeforeAction(object arg)
342342
343343 _security . CheckPathParamsFromAction ( httpContext , rootSpan , typedArg . ActionDescriptor ? . Parameters , typedArg . RouteData . Values ) ;
344344
345- if ( shouldUseIast )
345+ if ( iastEnabled )
346346 {
347347 rootSpan . Context . TraceContext . IastRequestContext ? . AddRequestData ( httpContext . Request , typedArg . RouteData ? . Values ) ;
348348 }
0 commit comments