Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pathnames starting with ./ immediately follow by a matching group can result in double-slash #158

Open
wanderview opened this issue Jan 19, 2022 · 1 comment

Comments

@wanderview
Copy link
Member

Consider this new URLPattern({ pathname: './*', baseURL: self.location }) evaluated on a page at /index.html'. The resulting pathname is //*` which is somewhat unexpected.

This occurs because the / preceding the * is treated as an implicit prefix. This causes the pathname encoder to see just /. which is collapsed to /. Then the /* is appended to get //*.

Authors can workaround this issue for this specific case one of two ways:

  1. new URLPattern({ pathname: './{*}', baseURL: self.location }); or
  2. new URLPattern({ pathname: '*', baseURL: self.location })

I don't have a good idea on how to fix this in the algorithm at the moment.

@wanderview
Copy link
Member Author

See also #156.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant