Skip to content

Commit

Permalink
feat: change cors policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Fatih Burak İlk committed Nov 7, 2024
1 parent 0999ad8 commit 216a339
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const handleUrls = async (req, res, next) => {
};

const cors = async (req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Origin', req.header('Origin'));
res.setHeader('Access-Control-Allow-Methods', 'GET, PUT, POST, DELETE, HEAD, OPTIONS');

if (req.method === 'OPTIONS') {
Expand Down

0 comments on commit 216a339

Please sign in to comment.