fix: take the first network found instead of the last one #5411
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Take the first network found instead of the last one that may be the docker bridge. This restores the same behavior as 5.0.4, this fixes a regression introduced in 5.1.0 where the default-gateway dependency was dropped.
For Bugs and Features; did you add new tests?
I tried to include a test and run it with
npm run test:only test/cli/hot-option.test.js
but I can't make it run on my machine, it's just blocking at
RUNS test/cli/hot-option.test.js
no idea why.
I also have lots of failing tests and other files blocking like this when I'm testing on my machine.
Hopefully the CI may execute the test, finger crossed.
Motivation / Use-Case
On version 5.0.4 with
--host local-ip
on Ubuntu, it returnedhttps://192.168.1.15:8080
On 5.1.0 and 5.2.0 it returns
https://172.17.0.1:8080
that is the docker bridge, not so useful.The new code introduced in #5255 was taking the last network of the networks array.
The change in this PR take the first one in networks array.
Breaking Changes
No breaking change, this fixes a regression introduced in 5.1.0 where the default-gateway dependency was dropped.
Additional Info