From 1aa5c5fa328cf53460373542f05ea851b0d74391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=E2=84=93e=20Hensel?= Date: Sun, 8 Jan 2023 13:57:04 +1300 Subject: [PATCH] Update CORS headers to support PNA spec --- source/utilities/server.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/utilities/server.ts b/source/utilities/server.ts index 259d527f..37fbb438 100644 --- a/source/utilities/server.ts +++ b/source/utilities/server.ts @@ -61,8 +61,11 @@ export const startServer = async ( chalk.cyan(requestUrl), ); - if (args['--cors']) + if (args['--cors']) { response.setHeader('Access-Control-Allow-Origin', '*'); + response.setHeader('Access-Control-Allow-Credentials', 'true'); + response.setHeader('Access-Control-Allow-Private-Network', 'true'); + } if (!args['--no-compression']) await compress(request as ExpressRequest, response as ExpressResponse);