-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get protocol in server-side rendering #2469
Comments
I think next use the express request so you should find it here: http://expressjs.com/fr/api.html#req.protocol |
@quentin-sommer we don't use express. Just the plain http server build into node.js. |
Well that's my bad! |
@hank7444 I dug in the req object, it has
I tested it only on localhost and as you see most of the fields are blank... I don't know if it's because I use a wrapper Expressjs server that calls next or if it's because of the localhost. Maybe you'll get what you want here. Be careful tho since |
It's safe to assume it's always |
I managed to do that with following line It looks dirty anyway |
Hi All!
My question is i need to get origin dynamically,
I try
req.headers
and I got:Yes!, I got host, but I also need the protocol, which needs to concat with host to create new api path. I browsed All req properties but I got nothing. Have any good idea? thx a lot!
The text was updated successfully, but these errors were encountered: