-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
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
groupsthrough 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.
Metadata
Metadata
Assignees
Labels
No labels