@@ -398,7 +398,7 @@ describe('getSanitizedUrlStringFromUrlObject', () => {
398398
399399describe ( 'getHttpSpanDetailsFromUrlObject' , ( ) => {
400400 it ( 'handles undefined URL object' , ( ) => {
401- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( undefined , 'test-origin' ) ;
401+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( undefined , 'server' , ' test-origin') ;
402402 expect ( name ) . toBe ( 'GET /' ) ;
403403 expect ( attributes ) . toEqual ( {
404404 'sentry.origin' : 'test-origin' ,
@@ -408,7 +408,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
408408
409409 it ( 'handles relative URL object' , ( ) => {
410410 const urlObject = parseStringToURLObject ( '/api/users' ) ! ;
411- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' ) ;
411+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'server' , ' test-origin') ;
412412 expect ( name ) . toBe ( 'GET /api/users' ) ;
413413 expect ( attributes ) . toEqual ( {
414414 'sentry.origin' : 'test-origin' ,
@@ -419,7 +419,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
419419
420420 it ( 'handles absolute URL object' , ( ) => {
421421 const urlObject = parseStringToURLObject ( 'https://example.com/api/users?q=test#section' ) ! ;
422- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' ) ;
422+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'server' , ' test-origin') ;
423423 expect ( name ) . toBe ( 'GET https://example.com/api/users' ) ;
424424 expect ( attributes ) . toEqual ( {
425425 'sentry.origin' : 'test-origin' ,
@@ -435,7 +435,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
435435
436436 it ( 'handles URL object with request method' , ( ) => {
437437 const urlObject = parseStringToURLObject ( 'https://example.com/api/users' ) ! ;
438- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' , { method : 'POST' } ) ;
438+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'server' , ' test-origin', { method : 'POST' } ) ;
439439 expect ( name ) . toBe ( 'POST https://example.com/api/users' ) ;
440440 expect ( attributes ) . toEqual ( {
441441 'sentry.origin' : 'test-origin' ,
@@ -450,7 +450,13 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
450450
451451 it ( 'handles URL object with route name' , ( ) => {
452452 const urlObject = parseStringToURLObject ( 'https://example.com/api/users' ) ! ;
453- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' , undefined , '/api/users/:id' ) ;
453+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject (
454+ urlObject ,
455+ 'server' ,
456+ 'test-origin' ,
457+ undefined ,
458+ '/api/users/:id' ,
459+ ) ;
454460 expect ( name ) . toBe ( 'GET /api/users/:id' ) ;
455461 expect ( attributes ) . toEqual ( {
456462 'sentry.origin' : 'test-origin' ,
@@ -465,7 +471,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
465471
466472 it ( 'handles root path URL' , ( ) => {
467473 const urlObject = parseStringToURLObject ( 'https://example.com/' ) ! ;
468- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' ) ;
474+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'server' , ' test-origin') ;
469475 expect ( name ) . toBe ( 'GET https://example.com/' ) ;
470476 expect ( attributes ) . toEqual ( {
471477 'sentry.origin' : 'test-origin' ,
@@ -479,7 +485,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
479485
480486 it ( 'handles URL with port' , ( ) => {
481487 const urlObject = parseStringToURLObject ( 'https://example.com:8080/api/users' ) ! ;
482- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' ) ;
488+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'server' , ' test-origin') ;
483489 expect ( name ) . toBe ( 'GET https://example.com:8080/api/users' ) ;
484490 expect ( attributes ) . toEqual ( {
485491 'sentry.origin' : 'test-origin' ,
@@ -494,7 +500,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
494500
495501 it ( 'handles URL with non-standard port and request method' , ( ) => {
496502 const urlObject = parseStringToURLObject ( 'https://example.com:3000/api/users' ) ! ;
497- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' , { method : 'PUT' } ) ;
503+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'server' , ' test-origin', { method : 'PUT' } ) ;
498504 expect ( name ) . toBe ( 'PUT https://example.com:3000/api/users' ) ;
499505 expect ( attributes ) . toEqual ( {
500506 'sentry.origin' : 'test-origin' ,
@@ -512,6 +518,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
512518 const urlObject = parseStringToURLObject ( 'https://example.com/api/users/123' ) ! ;
513519 const [ name , attributes ] = getHttpSpanDetailsFromUrlObject (
514520 urlObject ,
521+ 'server' ,
515522 'test-origin' ,
516523 { method : 'PATCH' } ,
517524 '/api/users/:id' ,
@@ -531,7 +538,13 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
531538
532539 it ( 'handles URL with query params and route name' , ( ) => {
533540 const urlObject = parseStringToURLObject ( 'https://example.com/api/search?q=test&page=1' ) ! ;
534- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' , undefined , '/api/search' ) ;
541+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject (
542+ urlObject ,
543+ 'server' ,
544+ 'test-origin' ,
545+ undefined ,
546+ '/api/search' ,
547+ ) ;
535548 expect ( name ) . toBe ( 'GET /api/search' ) ;
536549 expect ( attributes ) . toEqual ( {
537550 'sentry.origin' : 'test-origin' ,
@@ -547,7 +560,13 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
547560
548561 it ( 'handles URL with fragment and route name' , ( ) => {
549562 const urlObject = parseStringToURLObject ( 'https://example.com/api/docs#section-1' ) ! ;
550- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' , undefined , '/api/docs' ) ;
563+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject (
564+ urlObject ,
565+ 'server' ,
566+ 'test-origin' ,
567+ undefined ,
568+ '/api/docs' ,
569+ ) ;
551570 expect ( name ) . toBe ( 'GET /api/docs' ) ;
552571 expect ( attributes ) . toEqual ( {
553572 'sentry.origin' : 'test-origin' ,
@@ -563,7 +582,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
563582
564583 it ( 'handles URL with auth credentials' , ( ) => {
565584 const urlObject = parseStringToURLObject ( 'https://user:[email protected] /api/users' ) ! ; 566- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' ) ;
585+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'server' , ' test-origin') ;
567586 expect ( name ) . toBe ( 'GET https://%filtered%:%filtered%@example.com/api/users' ) ;
568587 expect ( attributes ) . toEqual ( {
569588 'sentry.origin' : 'test-origin' ,
@@ -577,7 +596,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
577596
578597 it ( 'handles URL with IPv4 address' , ( ) => {
579598 const urlObject = parseStringToURLObject ( 'https://192.168.1.1:8080/api/users' ) ! ;
580- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' ) ;
599+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'server' , ' test-origin') ;
581600 expect ( name ) . toBe ( 'GET https://192.168.1.1:8080/api/users' ) ;
582601 expect ( attributes ) . toEqual ( {
583602 'sentry.origin' : 'test-origin' ,
@@ -592,7 +611,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
592611
593612 it ( 'handles URL with IPv6 address' , ( ) => {
594613 const urlObject = parseStringToURLObject ( 'https://[2001:db8::1]:8080/api/users' ) ! ;
595- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' ) ;
614+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'server' , ' test-origin') ;
596615 expect ( name ) . toBe ( 'GET https://[2001:db8::1]:8080/api/users' ) ;
597616 expect ( attributes ) . toEqual ( {
598617 'sentry.origin' : 'test-origin' ,
@@ -607,7 +626,7 @@ describe('getHttpSpanDetailsFromUrlObject', () => {
607626
608627 it ( 'handles URL with subdomain' , ( ) => {
609628 const urlObject = parseStringToURLObject ( 'https://api.example.com/users' ) ! ;
610- const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'test-origin' ) ;
629+ const [ name , attributes ] = getHttpSpanDetailsFromUrlObject ( urlObject , 'server' , ' test-origin') ;
611630 expect ( name ) . toBe ( 'GET https://api.example.com/users' ) ;
612631 expect ( attributes ) . toEqual ( {
613632 'sentry.origin' : 'test-origin' ,
0 commit comments