WICG / storage-foundation-api-explainer

Explainer showcasing a new web storage API, NativeIO
Apache License 2.0
63 stars 8 forks source link

Filenames are unacceptably restrictive #11

Open hugo306 opened 3 years ago

hugo306 commented 3 years ago

Base64url is excluded because of case insensitivity, and even canonical GUID are excluded because of the lack of -

0-9A-Za-z_- is about the lowest common denominator between File System Access API, Cache API, ServiceWorker Request, IndexedDB keys, and most importantly for browsers: URLs

ddumont commented 3 years ago

I second this...

feross commented 3 years ago

We're finding the filenames unreasonably restrictive as well. This really hurts the ergonomics of the API, but I assume this will be fixed before this is shipped without a flag.

janl commented 3 years ago

At CouchDB, we went through acceptable characters across file systems, as we are mapping database names to file names directly and our acceptable regex is ^[a-z][a-z0-9_$()+/-]*$ (c.f. https://docs.couchdb.org/en/stable/api/database/common.html#put--db). We’ve gotten very few complaints about this, so this might be a workable middle ground.

rstz commented 3 years ago

Thank you, that's great to know! Your regex seems pretty similar to what we're doing, except for allowing 6 additional special characters.