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

Splat listen() args to only specify host when supplied #347

Merged
merged 1 commit into from Mar 10, 2018

Conversation

Qix-
Copy link
Contributor

@Qix- Qix- commented Mar 10, 2018

This more strictly abides by the contract that a non-specified host in the listen() call might behave differently if the system is running IPv4 vs IPv6 as per the documentation (since the documentation doesn't specify exactly what happens on an IPv4 system with '::').

@Qix- Qix- self-assigned this Mar 10, 2018
@@ -101,7 +100,12 @@ async function start() {
process.exit(1)
})

server.listen(flags.port, flags.host, () => {
const listenArgs = [flags.port || 0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would port be falsy if we default it to 3000?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TooTallNate empty string. I expected the option parser to accept an empty string as 'valid' and not use it as an excuse to fallback to default (where, instead, it should only populate the default if the -p option was never encountered at all).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.g. micro -p ''

Copy link
Member

@TooTallNate TooTallNate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Qix- Qix- merged commit 3191eea into master Mar 10, 2018
@Qix- Qix- deleted the default-listen-args branch March 10, 2018 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants