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

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

Closed
aleclarson opened this issue Mar 19, 2018 · 0 comments
Closed

Comments

@aleclarson
Copy link
Contributor

  • 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.

XadillaX added a commit to XadillaX/node that referenced this issue Mar 21, 2018
@trivikr trivikr closed this as completed in b06f686 Apr 3, 2018
targos pushed a commit that referenced this issue Apr 4, 2018
Fixes: #19457

PR-URL: #19502
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
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

Successfully merging a pull request may close this issue.

1 participant