Skip to content

Commit 8882a6c

Browse files
Apply suggestions from code review
Co-authored-by: Joe Haines <hello@joehaines.co.uk>
1 parent 1351d79 commit 8882a6c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/platforms/browser/lib/auto-instrumentation/resource-load-plugin.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,16 @@ export class ResourceLoadPlugin implements Plugin<BrowserConfiguration> {
4444
const entries = list.getEntries() as ResourceTiming[]
4545

4646
for (const entry of entries) {
47-
if (['fetch', 'xmlhttprequest'].includes(entry.initiatorType)) continue
47+
if (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest') {
48+
continue
49+
}
4850

4951
const parentContext = this.spanFactory.firstSpanContext
5052

5153
if (parentContext) {
5254
const url = new URL(entry.name)
53-
const name = url.href.replace(url.search, '')
55+
url.search = ''
56+
const name = url.href
5457

5558
const span = this.spanFactory.startSpan(`[ResourceLoad]${name}`, {
5659
parentContext,

0 commit comments

Comments
 (0)