Skip to content

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

Open

Description

@kyle-villeneuve

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?

Activity

  1. varrocs commented on Jan 24, 2022

    @varrocs
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions