镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[http_client] setHost: true should not prevent a default "Host" header #19457

Closed

Description

@aleclarson
  • Version: v9.8.0
  • Platform: N/A
  • Subsystem: N/A

var setHost = (options.setHost === undefined);

This should be options.setHost !== false so I can do the following:

https.request({
  setHost: opts.host !== false
}, cb)

Currently, I have to do the following:

let config = {}
if (opts.host === false) {
  config.setHost = false
}
https.request(config, cb)

In other words, setting setHost to true causes the "Host" header to not be set to a default value. This is confusing behavior.

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