Skip to content

Fix port via parse_url() when default URI is used #927

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

Merged
merged 1 commit into from
Sep 19, 2018

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Sep 19, 2018

The default URI is "mongodb://127.0.0.1/" and does not include a port. Since parse_url() will not yield a "port" index in that case we should fill in the default (i.e. 27017).

This is related to dd5e9e9 (#907).

The default URI is "mongodb://127.0.0.1/" and does not include a port. Since parse_url() will not yield a "port" index in that case we should fill in the default (i.e. 27017).

This is related to dd5e9e9.
@jmikola jmikola requested a review from derickr September 19, 2018 18:17
@jmikola
Copy link
Member Author

jmikola commented Sep 19, 2018

@derickr: If this looks good, please merge into v1.5 on your own (while tending to #926) and then up to master.

For some context, I discovered this while running a single node replica set on my local host and relying on the URI constant in basic.inc instead of a MONGODB_URI environment variable. Should be easy to repro if you like.

Copy link
Contributor

@derickr derickr left a comment

Choose a reason for hiding this comment

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

LGTM

@jmikola jmikola merged commit 6fee190 into mongodb:v1.5 Sep 19, 2018
@jmikola jmikola deleted the 1.5-parse_url branch September 19, 2018 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants