8 months ago
Access to XMLHttpRequest at 'https://fixitowner-production.up.railway.app/api/admin/dashboard/get' from origin 'https://fixity.netlify.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Cors issue even tho, my backend looks fine
const corsOptions: CorsOptions = {
origin: 'https://fixity.netlify.app',
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With'],
credentials: true,
exposedHeaders: ['Set-Cookie'],
};
app.use(cors(corsOptions));
app.options('*', cors(corsOptions));
Pinned Solution
8 months ago
Hey, can you try setting the header explicitly using a middleware?
7 Replies
8 months ago
.
uxuz
Hey, there is no Access-Control-Allow-Origin header.
8 months ago
Access-Control-Allow-Origin header exist when I use render, but when I try to use railway.
All of a sudden not access control allow origin
temuujin-bat
Access-Control-Allow-Origin header exist when I use render, but when I try to use railway.All of a sudden not access control allow origin
8 months ago
Does your application include the Access-Control-Allow-Origin header when run locally?
uxuz
Does your application include the Access-Control-Allow-Origin header when run locally?
8 months ago
yes
temuujin-bat
yes
8 months ago
Hey, can you try setting the header explicitly using a middleware?
uxuz
Hey, can you try setting the header explicitly using a middleware?
8 months ago
You are my savior
xD
Status changed to Solved parmstar • 8 months ago