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

fix(service-provider-core): allow specifying a host with _ characters MONGOSH-933 #1048

Merged
merged 1 commit into from Jul 30, 2021

Conversation

rose-m
Copy link
Contributor

@rose-m rose-m commented Jul 30, 2021

No description provided.

@rose-m rose-m self-assigned this Jul 30, 2021
Copy link
Contributor

@addaleax addaleax left a comment

Choose a reason for hiding this comment

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

Can we add a connectivity test (e.g. docker with a host with underscore in /etc/hosts) or at least verify that if we use mongosh --host foo_bar, it fails with a dns error, i.e. it is actually passed down to the OS?

This seems like something that could very easily regress because it is invalid and so regexps that do match valid hostnames will reject this (for example, this could also be something the driver validates).

@rose-m rose-m force-pushed the MONGOSH-933-allow-underscore-in-host branch from 7bdefbb to ed0bad6 Compare July 30, 2021 09:54
@rose-m
Copy link
Contributor Author

rose-m commented Jul 30, 2021

@addaleax Yeah makes a lot of sense 😅 I've added a test to check we really get a MongoNetworkError.

@rose-m rose-m force-pushed the MONGOSH-933-allow-underscore-in-host branch from ed0bad6 to af26598 Compare July 30, 2021 12:21
packages/cli-repl/test/e2e.spec.ts Outdated Show resolved Hide resolved
@rose-m rose-m force-pushed the MONGOSH-933-allow-underscore-in-host branch from af26598 to cbab738 Compare July 30, 2021 12:28
@rose-m rose-m merged commit 432988b into main Jul 30, 2021
@rose-m rose-m deleted the MONGOSH-933-allow-underscore-in-host branch July 30, 2021 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants