feat: ensure access-control-allow-origin matches public url
This commit is contained in:
@@ -92,7 +92,7 @@ app.get('/', function (req, res) {
|
|||||||
|
|
||||||
// Add CORS headers
|
// Add CORS headers
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
res.header('Access-Control-Allow-Origin', '*');
|
res.header('Access-Control-Allow-Origin', process.env.PUBLIC_URL || 'http://localhost:5173');
|
||||||
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
|
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
|
||||||
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
|
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
|
||||||
if (req.method === 'OPTIONS') {
|
if (req.method === 'OPTIONS') {
|
||||||
|
|||||||
Reference in New Issue
Block a user