-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: revert 06cfff93, fixes overridden options #1467
http: revert 06cfff93, fixes overridden options #1467
Conversation
@@ -0,0 +1,43 @@ | |||
const common = require('../common'); |
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 thought const
didn't work in sloppy mode?
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.
It didn't originally error for me, but I also thought so too so I added 'use strict';
in the new commit.
Would it be possible to split this in |
This reverts commit 06cfff9. Reverted because it introduced a regression where (because options were modified in the later functionality) options.host and options.port would be overridden with values provided in other, supported ways.
This commit adds a test to ensure all options are NOT modified after passing them to http.request. Specifically options.host and options.port are the most prominent that would previously error, but add the other options that have default values. options.host and options.port were overridden for the one-argument net.createConnection(options) call.
1c7778d
to
6e5cc0a
Compare
Updated for your comments @bnoordhuis. The revert commit has a title of longer than 50 chars now, I hope that is ok? |
Yes, revert commits get dispensation. LGTM. |
Is this okay as semver-patch? |
I would say so. It fixes a regression. |
Awesome, merging. |
This reverts commit 06cfff9. Reverted because it introduced a regression where (because options were modified in the later functionality) options.host and options.port would be overridden with values provided in other, supported ways. PR-URL: #1467 Reviewed-By: Ben Noordhuis <[email protected]>
This commit adds a test to ensure all options are NOT modified after passing them to http.request. Specifically options.host and options.port are the most prominent that would previously error, but add the other options that have default values. options.host and options.port were overridden for the one-argument net.createConnection(options) call. PR-URL: #1467 Reviewed-By: Ben Noordhuis <[email protected]>
|
personally i would at least change it to |
.. isn't this a breaking change though? I guess it landed on master, but still. Weekend patches. |
+1 |
@jonathanong maybe reopen #592? |
sure |
nope... too many tests are failing for me. |
This commit reverts commit 06cfff9 and adds a test that failed before
the revert. Options is in fact overridden in the code below the
util._extend()
call (specificallyoptions.port and options.host
) toallow for a one-argument
net.createConnection(options)
call.Alternatives
Since this commit could be
semver-major
as it reverts functionality that's been there for a while, even though the parent commit introduced a regression that should've beensemver-major
too, we should look into alternatives. These are some I see:_http_client.js
, handlecreateConnection
differently (I already have different functionality we could try in a separate branch I haven't PR'ed yet). I'm 👍 on this functionality.cc @jonathanong
ref #62 #593