R
Railway•13mo 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•13mo ago
Project ID: e16686fb-b7f0-46b3-a929-16ad1c2aee78
Aivic
AivicOP•13mo ago
service ID: e16686fb-b7f0-46b3-a929-16ad1c2aee78
Fragly
Fragly•13mo ago
Have you tried setting the CORS policy on your server to allow for requests from your localhost?
Aivic
AivicOP•13mo ago
@Fragly this is what I did
No description
Fragly
Fragly•13mo ago
okay I'm out of ideas 💀
Aivic
AivicOP•13mo ago
Alright
Brody
Brody•13mo ago
have you checked to see what cors headers are being sent on the failed request?
Aivic
AivicOP•13mo ago
The Accept control allow origin header
No description
Brody
Brody•13mo ago
what are the headers values
Aivic
AivicOP•13mo 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•13mo ago
#🛂|readme #5
Aivic
AivicOP•13mo ago
Sorry about that, just got here today because of this urgent problem
Brody
Brody•13mo 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
AivicOP•13mo ago
Okay
Want results from more Discord servers?
Add your server