File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ function fnv1a(input: string): number {
353353
354354function tunnelPathsFor ( tunnelOptions : TunnelOptions , allowedDsns : Array < string > ) : string [ ] {
355355 if ( tunnelOptions . path ) {
356- return [ tunnelOptions . path ] ;
356+ return [ tunnelOptions . path . replace ( / \/ $ / , '' ) ] ;
357357 }
358358
359359 return allowedDsns . map ( dsn => getTunnelPath ( dsn ) ) . filter ( ( path ) : path is string => ! ! path ) ;
Original file line number Diff line number Diff line change @@ -416,6 +416,11 @@ describe('getTunnelPaths', () => {
416416 ) ;
417417 } ) ;
418418
419+ it ( 'matches a fixed path that ends with a slash' , ( ) => {
420+ expect ( isTunnelRequest ( { method : 'POST' , url : '/monitor' } , { path : '/monitor/' } ) ) . toBe ( true ) ;
421+ expect ( isTunnelRequest ( { method : 'POST' , url : '/monitor/' } , { path : '/monitor/' } ) ) . toBe ( true ) ;
422+ } ) ;
423+
419424 it ( 'uses the managed tunnel config of the active client' , ( ) => {
420425 expect ( getTunnelPaths ( ) ) . toEqual ( [ ] ) ;
421426
@@ -498,6 +503,7 @@ describe('getTunnelIgnoreSpanFilter', () => {
498503 ) ,
499504 ) . toBe ( true ) ;
500505 expect ( urlPathMatcher ( getTunnelIgnoreSpanFilter ( { path : '/monitor' } , undefined ) ) . test ( '/monitor' ) ) . toBe ( true ) ;
506+ expect ( urlPathMatcher ( getTunnelIgnoreSpanFilter ( { path : '/monitor/' } , undefined ) ) . test ( '/monitor' ) ) . toBe ( true ) ;
501507 expect (
502508 urlPathMatcher ( getTunnelIgnoreSpanFilter ( { basePath : '/app/' } , makeDsn ( TEST_DSN ) ) ) . test (
503509 `/app${ getTunnelPath ( TEST_DSN ) } ` ,
You can’t perform that action at this time.
0 commit comments