-
Notifications
You must be signed in to change notification settings - Fork 534
DRIVERS 2922 Allow valid SRV hostnames with less than 3 parts #2972
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
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f405c06
Original solution
kyleburgess2025 1727360
Updating tests and implementation to allow 3 parts to SRV string
kyleburgess2025 0b12109
Fixing tests
kyleburgess2025 618275d
updating tests
kyleburgess2025 a65c297
typo
kyleburgess2025 25845e7
Making changes according to copilot autoreview
kyleburgess2025 2013f18
reverting changes to invalid-uris
kyleburgess2025 298afdc
responding to comments - rewriting tests and moving logic
kyleburgess2025 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,16 +56,6 @@ | |
| end | ||
| end | ||
|
|
||
| context 'when the host in URI does not have {hostname}, {domainname} and {tld}' do | ||
|
|
||
| let(:string) { "#{scheme}#{hosts}" } | ||
| let(:hosts) { '10gen.cc/' } | ||
|
|
||
| it 'raises an error' do | ||
| expect { uri }.to raise_error(Mongo::Error::InvalidURI) | ||
| end | ||
| end | ||
|
|
||
| context 'when the {tld} is empty' do | ||
|
|
||
| let(:string) { "#{scheme}#{hosts}" } | ||
|
|
@@ -220,24 +210,6 @@ | |
| expect { uri }.to raise_error(Mongo::Error::InvalidURI) | ||
| end | ||
| end | ||
|
|
||
| context 'mongodb+srv://example.com?w=1' do | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just removed this test, don't think this should throw under the new requirements. |
||
|
|
||
| let(:string) { "#{scheme}example.com?w=1" } | ||
|
|
||
| it 'raises an error' do | ||
| expect { uri }.to raise_error(Mongo::Error::InvalidURI) | ||
| end | ||
| end | ||
|
|
||
| context 'mongodb+srv://example.com/?w' do | ||
|
|
||
| let(:string) { "#{scheme}example.com/?w" } | ||
|
|
||
| it 'raises an error' do | ||
| expect { uri }.to raise_error(Mongo::Error::InvalidURI) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| describe 'valid uris' do | ||
|
|
@@ -1302,8 +1274,8 @@ | |
| 'a' | ||
| end | ||
|
|
||
| it 'raises an error' do | ||
| expect { validate }.to raise_error(Mongo::Error::InvalidURI) | ||
| it 'does not raise an error' do | ||
| expect { validate }.to_not raise_error | ||
| end | ||
| end | ||
|
|
||
|
|
@@ -1313,8 +1285,8 @@ | |
| 'a.b' | ||
| end | ||
|
|
||
| it 'raises an error' do | ||
| expect { validate }.to raise_error(Mongo::Error::InvalidURI) | ||
| it 'validates the hostname' do | ||
| expect { validate }.not_to raise_error | ||
| end | ||
| end | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️