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

Add support for serving well-known URIs with the @astrojs/node SSR adapter #5832

Merged
merged 2 commits into from
Jan 11, 2023

Conversation

HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Jan 11, 2023

Changes

This PR fixes #5813.

Well-Known locations, e.g. /.well-known/apple-app-site-association are properly served when running astro dev altho this is not the case for a production build served using the @astrojs/node SSR adapter.

This PR introduced changes discussed in #5813 and suggestions from @bluwy to properly serve well-known URIs (a URI whose path component begins with the characters "/.well-known/"). This is achieved with 2 changes:

  • During an SSR build, when copying over the public directory, dotfiles are now also copied over.
  • The @astrojs/node adapter no longer deny dotfiles for well-known URIs.

Testing

  1. I updated an astro test for static-build to ensure dotfiles from the public directory are copied over during an SSR build.
  2. I added new @astrojs/node tests in a well-known-locations suite to ensure well-known URIs are properly served while other dotfiles are not.

Docs

I couldn't find any mention of the current behavior in the documentation so I'm not sure if any changes are needed.

/cc @withastro/maintainers-docs for feedback!

@changeset-bot
Copy link

changeset-bot bot commented Jan 11, 2023

🦋 Changeset detected

Latest commit: 709acec

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope) labels Jan 11, 2023
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really clean PR. Tests are great too. Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dot files like .well-known files are not served with the node adapter
2 participants