-
Notifications
You must be signed in to change notification settings - Fork 30k
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: refactor to make servername option normalization testable #38733
Conversation
function normalizeServerName(options, req) { | ||
if (!options.servername && options.servername !== '') | ||
options.servername = calculateServerName(options, req); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we avoid mutating an argument in a function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it would be good to refactor that away. But can happen in a follow up PR.
ac673df
to
b43137a
Compare
function normalizeServerName(options, req) { | ||
if (!options.servername && options.servername !== '') | ||
options.servername = calculateServerName(options, req); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it would be good to refactor that away. But can happen in a follow up PR.
Landed in b866e38 |
Refs: https://coverage.nodejs.org/coverage-36bb31be5f0b85a0/lib/_http_agent.js.html#L316 PR-URL: nodejs#38733 Reviewed-By: Antoine du Hamel <[email protected]>
Refs: https://coverage.nodejs.org/coverage-36bb31be5f0b85a0/lib/_http_agent.js.html#L316 PR-URL: #38733 Reviewed-By: Antoine du Hamel <[email protected]>
Refs: https://coverage.nodejs.org/coverage-36bb31be5f0b85a0/lib/_http_agent.js.html#L316 PR-URL: nodejs#38733 Reviewed-By: Antoine du Hamel <[email protected]>
Refs: https://coverage.nodejs.org/coverage-36bb31be5f0b85a0/lib/_http_agent.js.html#L316