fix: make static folders with dot such as .well-known allowed#2929
Conversation
| * Fresh middleware to enable file-system based routing. | ||
| * ```ts | ||
| * // Enable Fresh static file serving | ||
| * app.use(freshStaticFles()); |
There was a problem hiding this comment.
Oops, good catch!
marvinhagemeister
left a comment
There was a problem hiding this comment.
Great idea, I didn't know that Chrome Devtools supported the .well-known directory. Thanks for making a PR and appreciate the addition of tests 👍
I think the tests could be structured a bit better, but was a bit lazy and combined them all into a single test 😅
I might try to create a PR for |
This PR intends to address an error logged when opening a DevTools in a Chromium based browser while using Fresh in dev mode.
See error
DevTools tries to load a
<root>/static/.well-known/appspecific/com.chrome.devtools.jsonfile, which incorrectly is flagged as "outside" the static directory, and thus generates errors instead of 404.Maybe hidden folders (starting with
.) in/staticshould be opt-in though? I'm not sure if anyone puts folders with.prefix insidestatic/without intending them to be accessible?..throws errors (outside staticDir).returns "missing file" (unlessconfig.allowHiddenFoldersis true)Automatic workspace folders
I think a follow-up PR could be for the Dev
Builderto also implement support for Automatic workspace folders, by returning JSON content automatically at.well-known/appspecific/com.chrome.devtools.json.I think a good first step is to allow
.<folder-name>, especially since.well-known/has many valid use-cases, and as such is not unreasonable to want to add static files in.