R
Railway•3d ago
tiltowait

Private networking - CORS?

I connect to my backend via private networking. Currently, I've allowed all origins, but I'd like to tighten it up. I'm not sure if there's a correct/dynamic way to do this in Railway, though. 12fe90d4-42ca-4704-980b-e16da59696c0
Solution:
The private network is only accessible internally, there wouldn't be much point doing that cause no one else can access it anyway
Jump to solution
11 Replies
Percy
Percy•3d ago
Project ID: 12fe90d4-42ca-4704-980b-e16da59696c0
Fragly
Fragly•3d ago
You want to add CORS to the private network?
Solution
Fragly
Fragly•3d ago
The private network is only accessible internally, there wouldn't be much point doing that cause no one else can access it anyway
tiltowait
tiltowait•3d ago
Okay, thanks!
maddsua
maddsua•3d ago
Also, cors is absolutely pointless outside of browsers
tiltowait
tiltowait•9h ago
This is inside a browser đź‘Ť but question answered
Brody
Brody•9h ago
how would someone's browser access something via the private network?
tiltowait
tiltowait•8h ago
By making a POST request through JS. This whole thing was an issue of dev env not matching deployment. Like I said, it’s fixed now
Brody
Brody•8h ago
Then I must be misunderstanding something, its a private network, someone's browser can not make a request to a private domain, it would not be a very private network if you could
tiltowait
tiltowait•8h ago
It was my misunderstanding. I needed to disable CORS in local dev (allow my localhost, really). When I uploaded to railway, the page refused to render, citing mixed HTTP/HTTPS. I fixed that by using a reverse proxy and didn’t stop to think I was no longer doing a request from the browser in the first place 👍
Brody
Brody•8h ago
well as long as it works now!
Want results from more Discord servers?
Add your server