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

Uses port from SRVRecord #324

Merged
merged 1 commit into from
Oct 19, 2023
Merged

Conversation

maciejpiotrowski89
Copy link
Contributor

@maciejpiotrowski89 maciejpiotrowski89 commented Oct 18, 2023

Description

Uses port specified in an SRVRecord instead of overwriting the port from initial ConnectionSettings.Host.port value.

Motivation and Context

When mongodb+srv// scheme is used to connect to a database it uses default port number 27017. Hosts resolved from the service might use arbitrary port numbers. Using default port to connect to hosts leads to connection error.

How Has This Been Tested?

I successfully connected to database via mongodb+srv// scheme that resolved hosts requiring specific port number.

Screenshot 2023-10-18 at 15 55 42

Checklist:

  • If applicable, I have updated the documentation accordingly.
  • If applicable, I have added tests to cover my changes.

@Joannis Joannis merged commit f05069c into orlandos-nl:main Oct 19, 2023
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