You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want our app to serve a file on the path /.well-known/apple-app-site-association. So I have put the file at that path public/.well-known/apple-app-site-association.
When running npm run dev, the file is being served, a curl http://127.0.0.1:3000/.well-known/apple-app-site-association returns a 200.
With a production build (npm run build), the file is not being served via node ./dist/server/entry.mjs. The same curl returns a 404. (node 16.19.0 on macos, docker image node:16-alpine on linux)
I can see that the .well-known folder is being properly copied by the build into dist/client/.well-known. But no file or directory starting with a dot is being served.
All that has been observed on our real project, on macos and linux.
I then tried to start a new astro project from scratch, on macos, basically just running:
npm create astro@latest
npm install @astrojs/node
create a file at public/.well-known/apple-app-site-association
In dev, it works, npm run dev and curl http://127.0.0.1:3000/.well-known/apple-app-site-association returns a 200.
With a build, it doesn't: npm run build and node ./dist/server/entry.mjs then curl http://127.0.0.1:3000/.well-known/apple-app-site-association returns a 404. But this time, I cannot see any .well-know directory in dist/client.
I would expect the node server to serve any file of the public folder, even the dot files.
Link to Minimal Reproducible Example
Participation
I am willing to submit a pull request for this issue.
The text was updated successfully, but these errors were encountered:
I guess this should only be done when copying the public directory so potentially configurable through a new parameter to copyFiles(fromFolder: URL, toFolder: URL), e.g. copyFiles(fromFolder: URL, toFolder: URL, includeDotfiles = false).
The dotfiles property should be changed to allow to properly serve dotfiles.
After testing locally both changes, a .well-known/apple-app-site-association in the public folder can properly be saved.
I could make a PR altho I'm not sure what is the desired behavior. The dotfiles: 'deny' configuration seems to have been written on purpose, so can we change it easily? Should this be configurable somehow?
@HiDeoo thanks for digging this out! It looks like your proposed changes make sense to me. Re:
I could make a PR altho I'm not sure what is the desired behavior. The dotfiles: 'deny' configuration seems to have been written on purpose, so can we change it easily? Should this be configurable somehow?
I think we can make it allow if the pathname starts with /.well-known/, and deny otherwise.
What version of
astro
are you using?1.9.1
Are you using an SSR adapter? If so, which one?
Node
What package manager are you using?
npm
What operating system are you using?
Mac,Linux
Describe the Bug
We want our app to serve a file on the path
/.well-known/apple-app-site-association
. So I have put the file at that pathpublic/.well-known/apple-app-site-association
.When running
npm run dev
, the file is being served, acurl http://127.0.0.1:3000/.well-known/apple-app-site-association
returns a 200.With a production build (
npm run build
), the file is not being served vianode ./dist/server/entry.mjs
. The same curl returns a 404. (node 16.19.0 on macos, docker image node:16-alpine on linux)I can see that the
.well-known
folder is being properly copied by the build intodist/client/.well-known
. But no file or directory starting with a dot is being served.All that has been observed on our real project, on macos and linux.
I then tried to start a new astro project from scratch, on macos, basically just running:
npm create astro@latest
npm install @astrojs/node
public/.well-known/apple-app-site-association
export default defineConfig({ output: "server", adapter: node({ mode: "standalone", }), });
In dev, it works,
npm run dev
andcurl http://127.0.0.1:3000/.well-known/apple-app-site-association
returns a 200.With a build, it doesn't:
npm run build
andnode ./dist/server/entry.mjs
thencurl http://127.0.0.1:3000/.well-known/apple-app-site-association
returns a 404. But this time, I cannot see any.well-know
directory indist/client
.I would expect the node server to serve any file of the
public
folder, even the dot files.Link to Minimal Reproducible Example
Participation
The text was updated successfully, but these errors were encountered: