R
Railwayβ€’17mo ago
dolu_

URLs from request object are http instead of https

Hi, I'm using adonisjs and checking request object to get the url called by the user. URL got from this request object contains http://xxx.up.railway.app/login but user is on https://xxx.up.railway.app and the HTTP request is in https. Deployment method is docker
Solution:
it's completely safe to assume https when running on railway
Jump to solution
16 Replies
Percy
Percyβ€’17mo ago
Project ID: 9c4619f9-e594-4de9-90e3-8bf2b917df73
dolu_
dolu_OPβ€’17mo ago
9c4619f9-e594-4de9-90e3-8bf2b917df73
Brody
Brodyβ€’17mo ago
your service would see the request as http, that is normal
dolu_
dolu_OPβ€’17mo ago
Because of a reverse proxy?
Brody
Brodyβ€’17mo ago
correct
dolu_
dolu_OPβ€’17mo ago
I don't have this kind of problem elsewhere, like with a server with caddy
Brody
Brodyβ€’17mo ago
i dont quite see the problem though?
dolu_
dolu_OPβ€’17mo ago
I would have hoped if a request is send to https://service.com, the request.url would be https://service.com and not http://service.com
Brody
Brodyβ€’17mo ago
can you maybe tell me how that would cause issues? i just cant imagine how that would cause a problem
dolu_
dolu_OPβ€’17mo ago
User sign an object client side containing the url he will call later This object contains https://. On the backend, I have to verify if the request url and url contained in the signed object match
Solution
Brody
Brodyβ€’17mo ago
it's completely safe to assume https when running on railway
dolu_
dolu_OPβ€’17mo ago
Yes that's what I will do I do not have other option πŸ˜•
Brody
Brodyβ€’17mo ago
the proxy makes the request to your app with http, its just how it works
dolu_
dolu_OPβ€’17mo ago
I understand Thank you πŸ™
Brody
Brodyβ€’17mo ago
no problem πŸ™‚
dolu_
dolu_OPβ€’17mo ago
Bye
Want results from more Discord servers?
Add your server