POST being redirected to HTTP instead of HTTPS

Hi, I have a FastAPI API deployed on Runway, but my frontend keeps failing to POST to it due to a mixed content HTTP error. The URL I'm sending the request to is the correct HTTPS one, but it seems it's being redirected. Could you please help point me in the right direction to fix this?
9 Replies
Percy
Percy17mo ago
Project ID: 092f02c5-b080-4291-b0aa-eb14ac78ce54
large_carbon_model
large_carbon_modelOP17mo ago
092f02c5-b080-4291-b0aa-eb14ac78ce54
Brody
Brody17mo ago
show me a screenshot of where the request originates in code please
large_carbon_model
large_carbon_modelOP17mo ago
This is the request in the frontend (not hosted on Railway), with API_BASE_URL equal to my Railway generated domain with HTTPS.
Brody
Brody17mo ago
alright, show me the network request in the browsers dev tools now please
large_carbon_model
large_carbon_modelOP17mo ago
Brody
Brody17mo ago
your app (not railway!) is sending a 307 temporary redirect to the non https address it was requested from
large_carbon_model
large_carbon_modelOP17mo ago
Thank you so much, I'm an idiot 🤦‍♂️
Brody
Brody17mo ago
no youre not
Want results from more Discord servers?
Add your server