summaryrefslogtreecommitdiff
path: root/packages/integrations/node/src
diff options
context:
space:
mode:
authorGravatar HiDeoo <494699+HiDeoo@users.noreply.github.com> 2023-01-11 10:52:51 +0100
committerGravatar GitHub <noreply@github.com> 2023-01-11 17:52:51 +0800
commit692b199ec9384cb24d84b538a4bbde8a56073e8e (patch)
treedbfe14d4b29e7ce11f8a1d91640e56e53fd473e5 /packages/integrations/node/src
parent37d133275643aec1b67ea574f6950e7793e53b4d (diff)
downloadastro-692b199ec9384cb24d84b538a4bbde8a56073e8e.tar.gz
astro-692b199ec9384cb24d84b538a4bbde8a56073e8e.tar.zst
astro-692b199ec9384cb24d84b538a4bbde8a56073e8e.zip
Add support for serving well-known URIs with the @astrojs/node SSR adapter (#5832)
Diffstat (limited to 'packages/integrations/node/src')
-rw-r--r--packages/integrations/node/src/http-server.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/integrations/node/src/http-server.ts b/packages/integrations/node/src/http-server.ts
index bdd628c29..19e33c84a 100644
--- a/packages/integrations/node/src/http-server.ts
+++ b/packages/integrations/node/src/http-server.ts
@@ -17,10 +17,11 @@ export function createServer(
) {
const listener: http.RequestListener = (req, res) => {
if (req.url) {
- const pathname = '/' + removeBase(req.url);
+ let pathname = removeBase(req.url);
+ pathname = pathname[0] === '/' ? pathname : '/' + pathname;
const stream = send(req, encodeURI(pathname), {
root: fileURLToPath(client),
- dotfiles: 'deny',
+ dotfiles: pathname.startsWith('/.well-known/') ? 'allow' : 'deny',
});
let forwardError = false;