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(
138
138
) : WrappedRequestMethodFactory {
139
139
// We're caching results so we don't have to recompute regexp every time we create a request.
140
140
const createSpanUrlMap = new LRUMap < string , boolean > ( 100 ) ;
141
- const headersUrlMap : Record < string , boolean > = { } ;
141
+ const headersUrlMap = new LRUMap < string , boolean > ( 100 ) ;
142
142
143
143
const shouldCreateSpan = ( url : string ) : boolean => {
144
144
if ( tracingOptions ?. shouldCreateSpanForRequest === undefined ) {
@@ -160,13 +160,14 @@ function _createWrappedRequestMethodFactory(
160
160
return true ;
161
161
}
162
162
163
- if ( headersUrlMap [ url ] ) {
164
- return headersUrlMap [ url ] ;
163
+ const cachedDecision = headersUrlMap . get ( url ) ;
164
+ if ( cachedDecision !== undefined ) {
165
+ return cachedDecision ;
165
166
}
166
167
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 ;
170
171
} ;
171
172
172
173
return function wrappedRequestMethodFactory ( originalRequestMethod : OriginalRequestMethod ) : WrappedRequestMethod {
You can’t perform that action at this time.
0 commit comments