During the call in w3c/ServiceWorker#1535 we discussed the optional prefix behavior. For example:
new URLPattern({ pathname: '/foo/:bar?' });
Would match:
But would not match:
The main point of the feature is to avoid matching the /foobar here, but not matching /foo/ may be a problem for sites that normalize URLs with a trailing slash.
This discrepancy could be because the proposal is currently based on "strict" path-to-regexp mode instead of "default" mode. In "default" mode a trailing "/" is always permitted.
This issue is to figure out how to handle this. Should we switch the proposal to use default mode which is what most developers use? Should we do something different for optional prefix behavior?