R
Railway•12mo ago
Aivic

CORS

I've deployed my FastAPI api on railway it works fine but when frontend wants to access it there's a redirect and cors error.
No description
No description
No description
14 Replies
Percy
Percy•12mo ago
Project ID: e16686fb-b7f0-46b3-a929-16ad1c2aee78
Aivic
Aivic•12mo ago
service ID: e16686fb-b7f0-46b3-a929-16ad1c2aee78
Fragly
Fragly•12mo ago
Have you tried setting the CORS policy on your server to allow for requests from your localhost?
Aivic
Aivic•12mo ago
@Fragly this is what I did
No description
Fragly
Fragly•12mo ago
okay I'm out of ideas 💀
Aivic
Aivic•12mo ago
Alright
Brody
Brody•12mo ago
have you checked to see what cors headers are being sent on the failed request?
Aivic
Aivic•12mo ago
The Accept control allow origin header
No description
Brody
Brody•12mo ago
what are the headers values
Aivic
Aivic•12mo ago
I don't understand please Accept, Accept-Language, Content-Language and Content-Type are the list of the http request headers, this is from fastapi documentation. The wildcard "*" allows for all
Brody
Brody•12mo ago
#🛂|readme #5
Aivic
Aivic•12mo ago
Sorry about that, just got here today because of this urgent problem
Brody
Brody•12mo ago
im sorry but these help threads are for issues relating to railway, coding help is a bit out of the scope of these threads
Aivic
Aivic•12mo ago
Okay
Want results from more Discord servers?
Add your server