Steps to reproduce
"urlpattern-polyfill": "^10.0.0"
import { URLPattern } from 'urlpattern-polyfill'
let p = new URLPattern('https://example.com')
p.exec('https://example.com/')
Expected result
I expect the pattern to:
- Match.
- Have no entries in the
groups through the entire match result.
Actual result
The pattern does match, but it incorrectly reports the trailing slash "/" as a group match for the pathname segment:
{
inputs: [ 'https://example.com/' ],
protocol: { input: 'https', groups: {} },
username: { input: '', groups: { '0': '' } },
password: { input: '', groups: { '0': '' } },
hostname: { input: 'example.com', groups: {} },
port: { input: '', groups: {} },
+ pathname: { input: '/', groups: { '0': '/' } },
search: { input: '', groups: { '0': '' } },
hash: { input: '', groups: { '0': '' } }
}
Since I haven't declared any matching groups there (i.e. wildcards or parameters), I don't expect to get any match results.
Additional info
This is reproducible on v10, not reproducible on v9.
Steps to reproduce
Expected result
I expect the pattern to:
groupsthrough the entire match result.Actual result
The pattern does match, but it incorrectly reports the trailing slash
"/"as a group match for thepathnamesegment:{ inputs: [ 'https://example.com/' ], protocol: { input: 'https', groups: {} }, username: { input: '', groups: { '0': '' } }, password: { input: '', groups: { '0': '' } }, hostname: { input: 'example.com', groups: {} }, port: { input: '', groups: {} }, + pathname: { input: '/', groups: { '0': '/' } }, search: { input: '', groups: { '0': '' } }, hash: { input: '', groups: { '0': '' } } }Since I haven't declared any matching groups there (i.e. wildcards or parameters), I don't expect to get any match results.
Additional info
This is reproducible on v10, not reproducible on v9.