Skip to content

PYTHON-5288: SRV hostname validation fails when resolver and resolved hostnames are identical with three domain levels #2272

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 7 commits into from
Apr 9, 2025

Conversation

aclark4life
Copy link
Contributor

No description provided.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

pymongo/synchronous/srv_resolver.py:140

  • [nitpick] Consider assigning node[0].lower() to a variable (e.g., host) to improve readability and avoid repeated method calls.
if self.__fqdn == node[0].lower() and len(node[0].split(".")) < 3:

pymongo/asynchronous/srv_resolver.py:140

  • [nitpick] Consider assigning node[0].lower() to a variable (e.g., host) to improve readability and avoid repeated method calls.
if self.__fqdn == node[0].lower() and len(node[0].split(".")) < 3:

Copy link
Member

@ShaneHarvey ShaneHarvey left a comment

Choose a reason for hiding this comment

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

Could you please update the PR title to be more descriptive (and include the jira ticket) and add a changelog entry?

@aclark4life aclark4life changed the title Fix SRV hostname validation fails When the SRV hostname has three or more dot-separated parts it is valid for the returned hostnames to be identical. Apr 9, 2025
@aclark4life aclark4life changed the title When the SRV hostname has three or more dot-separated parts it is valid for the returned hostnames to be identical. PYTHON-5288: SRV hostname validation fails when resolver and resolved hostnames are identical with three domain levels Apr 9, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

@aclark4life aclark4life requested a review from ShaneHarvey April 9, 2025 19:11
@aclark4life aclark4life requested a review from ShaneHarvey April 9, 2025 19:40
@ShaneHarvey
Copy link
Member

Looks good, let's add the changelog entry.

@aclark4life aclark4life merged commit 86e221e into mongodb:master Apr 9, 2025
36 checks passed
@aclark4life aclark4life deleted the PYTHON-5288 branch April 9, 2025 22:00
blink1073 pushed a commit to blink1073/mongo-python-driver that referenced this pull request Apr 10, 2025
… hostnames are identical with three domain levels (mongodb#2272)

(cherry picked from commit 86e221e)
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.

None yet

2 participants