Uh oh!
There was an error while loading. Please reload this page.
http: revert 06cfff93, fixes overridden options - #1467
Conversation
There was a problem hiding this comment.
I thought const didn't work in sloppy mode?
There was a problem hiding this comment.
It didn't originally error for me, but I also thought so too so I added 'use strict'; in the new commit.
bnoordhuis
commented
Apr 18, 2015
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
6e5cc0aComparebrendanashworth
commented
Apr 18, 2015
Updated for your comments @bnoordhuis. The revert commit has a title of longer than 50 chars now, I hope that is ok? |
bnoordhuis
commented
Apr 18, 2015
Yes, revert commits get dispensation. LGTM. |
brendanashworth
commented
Apr 18, 2015
Is this okay as semver-patch? |
bnoordhuis
commented
Apr 18, 2015
I would say so. It fixes a regression. |
brendanashworth
commented
Apr 18, 2015
Awesome, merging. |
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 <info@bnoordhuis.nl>
brendanashworth
commented
Apr 18, 2015
jonathanong
commented
Apr 19, 2015
|
jonathanong
commented
Apr 19, 2015
personally i would at least change it to |
Fishrock123
commented
Apr 19, 2015
.. isn't this a breaking change though? I guess it landed on master, but still. Weekend patches. |
rlidwka
commented
Apr 19, 2015
+1 |
brendanashworth
commented
Apr 19, 2015
@jonathanong maybe reopen #592? |
jonathanong
commented
Apr 19, 2015
sure |
jonathanong
commented
Apr 19, 2015
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-majoras it reverts functionality that's been there for a while, even though the parent commit introduced a regression that should've beensemver-majortoo, we should look into alternatives. These are some I see:_http_client.js, handlecreateConnectiondifferently (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