@@ -134,6 +134,15 @@ it('should work with glob', async () => {
134134 expect ( urlMatches ( undefined , 'https://playwright.dev/foobar' , 'https://playwright.dev/fooBAR' ) ) . toBeFalsy ( ) ;
135135 expect ( urlMatches ( undefined , 'https://playwright.dev/foobar?a=b' , 'https://playwright.dev/foobar?A=B' ) ) . toBeFalsy ( ) ;
136136
137+ // Literal globs are normalized through new URL(), so explicit default ports,
138+ // percent-encoding and IDN hosts match request.url() which is already normalized.
139+ expect ( urlMatches ( undefined , 'http://example.com/path' , 'http://example.com:80/path' ) ) . toBeTruthy ( ) ;
140+ expect ( urlMatches ( undefined , 'https://example.com/path' , 'https://example.com:443/path' ) ) . toBeTruthy ( ) ;
141+ expect ( urlMatches ( undefined , 'http://example.com:8080/path' , 'http://example.com:8080/path' ) ) . toBeTruthy ( ) ;
142+ expect ( urlMatches ( undefined , 'http://localhost/' , 'http://localhost:80/**' ) ) . toBeTruthy ( ) ;
143+ expect ( urlMatches ( undefined , 'http://example.com/foo%20bar' , 'http://example.com/foo bar' ) ) . toBeTruthy ( ) ;
144+ expect ( urlMatches ( undefined , 'http://xn--mnchen-3ya.de/' , 'http://münchen.de/' ) ) . toBeTruthy ( ) ;
145+
137146 expect ( urlMatches ( undefined , 'https://localhost:3000/?a=b' , '**/?a=b' ) ) . toBeTruthy ( ) ;
138147 expect ( urlMatches ( undefined , 'https://localhost:3000/?a=b' , '**?a=b' ) ) . toBeTruthy ( ) ;
139148 expect ( urlMatches ( undefined , 'https://localhost:3000/?a=b' , '**=b' ) ) . toBeTruthy ( ) ;
0 commit comments