Skip to content

https: https.Server should be more careful with passed options #13584

Description

@mscdex
  • Version: all
  • Platform: n/a
  • Subsystem: https

Currently the https.Server constructor has two issues:

  • It does not check that the user-provided opts is truthy before trying to access properties on the value
  • It mutates the user-provided opts if certain properties on it are false-y

Activity

  1. added
    good first issueIssues that are suitable for first-time contributors.
    httpsIssues and PRs related to the https subsystem.
    on Jun 9, 2017
  2. changed the title [-]https.Server should be more careful with passed options[/-] [+]https: https.Server should be more careful with passed options[/+] on Jun 9, 2017
  3. XadillaX commented on Jun 10, 2017

    @XadillaX
    Contributor

    Did you mean opts = opts || {};?

  4. chyzwar commented on Jun 10, 2017

    @chyzwar

    Imo better to use default params.

     Server(handler, opts={})
    
  5. XadillaX commented on Jun 10, 2017

    @XadillaX
    Contributor

    @chyzwar but opts is the first argument.

  6. mscdex commented on Jun 10, 2017

    @mscdex
    ContributorAuthor

    @XadillaX As far as the second issue, you would have to make a copy (e.g. using util._extend() like most other places in core) of opts, provided it's an object. Otherwise use an empty object (or perhaps an object literal with the default properties/values already in place).

  7. XadillaX commented on Jun 10, 2017

    @XadillaX
    Contributor

    @mscdex I'll take this work then.

  8. refack commented on Jun 14, 2017

    @refack
    Contributor

    Closed by c1c2267

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

    good first issueIssues that are suitable for first-time contributors.httpsIssues and PRs related to the https subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions