Skip to content

Commit

Permalink
Update CORS headers to support PNA spec (#753)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-yle authored Jan 9, 2023
1 parent 30c8978 commit 12d561f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/utilities/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 12d561f

Please sign in to comment.