File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
packages/node/src/integrations Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ function _createWrappedRequestMethodFactory(
138138) : WrappedRequestMethodFactory {
139139 // We're caching results so we don't have to recompute regexp every time we create a request.
140140 const createSpanUrlMap = new LRUMap < string , boolean > ( 100 ) ;
141- const headersUrlMap : Record < string , boolean > = { } ;
141+ const headersUrlMap = new LRUMap < string , boolean > ( 100 ) ;
142142
143143 const shouldCreateSpan = ( url : string ) : boolean => {
144144 if ( tracingOptions ?. shouldCreateSpanForRequest === undefined ) {
@@ -160,13 +160,14 @@ function _createWrappedRequestMethodFactory(
160160 return true ;
161161 }
162162
163- if ( headersUrlMap [ url ] ) {
164- return headersUrlMap [ url ] ;
163+ const cachedDecision = headersUrlMap . get ( url ) ;
164+ if ( cachedDecision !== undefined ) {
165+ return cachedDecision ;
165166 }
166167
167- headersUrlMap [ url ] = stringMatchesSomePattern ( url , tracingOptions . tracePropagationTargets ) ;
168-
169- return headersUrlMap [ url ] ;
168+ const decision = stringMatchesSomePattern ( url , tracingOptions . tracePropagationTargets ) ;
169+ headersUrlMap . set ( url , decision ) ;
170+ return decision ;
170171 } ;
171172
172173 return function wrappedRequestMethodFactory ( originalRequestMethod : OriginalRequestMethod ) : WrappedRequestMethod {
You can’t perform that action at this time.
0 commit comments