R
Railway•2mo 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•2mo ago
Project ID: 12fe90d4-42ca-4704-980b-e16da59696c0
Fragly
Fragly•2mo ago
You want to add CORS to the private network?
Solution
Fragly
Fragly•2mo 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
tiltowaitOP•2mo ago
Okay, thanks!
maddsua
maddsua•2mo ago
Also, cors is absolutely pointless outside of browsers
tiltowait
tiltowaitOP•2mo ago
This is inside a browser đź‘Ť but question answered
Brody
Brody•2mo ago
how would someone's browser access something via the private network?
tiltowait
tiltowaitOP•2mo 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•2mo 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
tiltowaitOP•2mo 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•2mo ago
well as long as it works now!
Want results from more Discord servers?
Add your server