Skip to content
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

req.connection.encrypted is undefined in node:14 #223

Open
kyle-villeneuve opened this issue Jan 18, 2022 · 1 comment
Open

req.connection.encrypted is undefined in node:14 #223

kyle-villeneuve opened this issue Jan 18, 2022 · 1 comment

Comments

@kyle-villeneuve
Copy link

Need to replace with req.encrypted ? "https" : "http" or more succinctly req.protocol

var protocol = req.connection.encrypted ? "https" : "http";

tried to push my branch to make a PR but I got access denied, can an existing contributor pr this?

@varrocs
Copy link
Contributor

varrocs commented Jan 24, 2022

Hello!

How did this cause an issue?
With a plain http connection encrypted is undefined, that's true. But that's falsy so protocol is going to be 'http'. When the connection is https it is defined and it's true (at least with express) so protocol will be 'https'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants