R
Railway

✋|help

'The information you’re about to submit is not secure'

Aaustinm9/1/2023
I have a very simple fastAPI page that I just began hosting through github on railway. It has a text file upload form. When the form is submitted, the page shows:

The information you’re about to submit is not secure
Because this form is being submitted using a connection that’s not secure, your information will be visible to others.

I can click 'send anyway' and the site continues as intended, I just don't want that message popping up for users. I have cleared cache, and tried on other devices.
Aaustinm9/1/2023
76839ba3-823f-432f-8aa5-804dc9bf80d7
here is the site: https://fastapi-production-23e9.up.railway.app/
Bbrody1929/1/2023
your flask server is sending a 307 redirect response back on that post request, to the same url but unsecure
Bbrody1929/1/2023
Bbrody1929/1/2023
Aaustinm9/1/2023
yeah, I tried fixing that by explicitly stating https in the form submit: <form action="https://fastapi-production-23e9.up.railway.app/uploadfile" method="post" enctype="multipart/form-data" id="uploadForm">
But still get the redirect to http
Bbrody1929/1/2023
that wouldnt fix it, this is the flask server thats sending the redirect response
if you have some type of middleware that makes sure incoming requests are performed with https, you can either trust the proxy headers or remove it since you just cant use http on railway anyway
Aaustinm9/1/2023
ok thanks. Let me check the middleware. Sorry if I have stupid questions, kinda new to this
Bbrody1929/1/2023
no worries at all
Aaustinm9/1/2023
I added this to the fastapi backend:

app.add_middleware(TrustedHostMiddleware, allowed_hosts=["*"], allow_any=True)

app.add_middleware(HTTPSRedirectMiddleware)

Not sure if this is the correct approach but the app is just not working at all now haha
'This page isn’t workingfastapi-production-23e9.up.railway.app is currently unable to handle this request.'
Bbrody1929/1/2023
i did say you can remove the https redirect middleware and you then added it lol
Aaustinm9/1/2023
haha my bad. I thought I needed that. I didn't have any middleware setup previously. Can you tell me if my undertsanding is correct: When the app gets a request to the upload endpoint, it is being redirected via http which is insecure. So I need to make sure it is not redirecting to http??
Bbrody1929/1/2023
correct, somewhere in your code there is something that is trying to redirect the incoming request to http
Aaustinm9/1/2023
got it working. Changed the endpoint from /upload_file to /upload_file/. Really don't know how I would've figured that out besides dumb luck.

Thanks for your help and patience
Bbrody1929/1/2023
no problem!

Looking for more? Join the community!

Recommended Posts
Payment shows unsuccessful even though it's notHello, I got an email today morning about last month usage (1 Aug - 1 Sep) payment shows unsuccessfDeployment issues in Spring Boot projectHello, I am a newcomer using the Hobby Plan. My project is built on the Spring Boot platform and runBackup DatabaseHi, is it possible to perform or schedule database backups on railway? If so, could you explain howIssuing TLS certificate ongoing for 4 days nowHey folks, I've added a CNAME dns on my domain on Monday, and then it changed the status on the railfrontend web app making requests to wrong endpointOn my frontend web app I have a env variable configured to be the endpoint of my application but wheI have run graphql api for railway, I want to know how I can add custom domain by using this api.from the graph ql api, I can query project info and add plugins to project. But I do not know how toIs there an easy way to pause a project?Hello, we have a secondary development environment that we need for testing every once in a while. Ideployed flowise bot, no url generatedI have deployed a flowise bot and I have a hobby tier on railway. The issue is that after the deployDoes anyone know how to enable mongoDB drivers in a php/laravel project?Y tried to added with this command in the env tab NIXPACKS_PKGS=php81Extensions.mongodb But it stillInstalling php-gd extensionIs there a way for me to use Nixpacks to install php-gd in the setup stage of the build process. Or bind [::1]:5433: Cannot assign requested addressI'm trying to use an SSH tunnel and need to bind to my local port 5433 but keep getting this error. charged for hobby plan ?I have been charged 5 dollars for the hobby plan whilst my usage was below it and every month i had Custom Domain - Waiting for DNS updateI have deployed an app on Railway and set up a custom domain. I've tried to get the custom domain tDeployment has crashed with FileNotFoundError: [Errno 2]Hi. I am have problem with my JSON file. I try to deploy my flask chatbot project the have function nocodb - update failedHi I am testing the railway nocodb hosting, I was informed by the nocodb that there is an update thaDoes waived hobby plan fee expire?I am on hobby plan (previously developer) and I have the hobby plan waived. I would like to confirm Deployment issues in Golang projectProject id : 4e543459-a744-4198-970b-be420281426a I am trying to deploy a go lang application, it's Using a custom domain with cloudflarehi! I'm ready to deploy my project to my domain, and now railway has detected my cname record, but icron job timezoneGreetings! I want to host a script which runs at a certain time relative to my time zone (GMT+3). Whtsc: Permission deniedI just subscribed to the Hobby Plan and am trying to deploy my first backend. It was working fine i