Skip to content

Remove hostnameMaxLen for Mongo URL #6693

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 2 commits into from
Oct 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/vendor/mongodbUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const portPattern = /:[0-9]*$/;
// Special case for a simple path URL
const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/;

const hostnameMaxLen = 255;
// protocols that can allow "unsafe" and "unwise" chars.
const unsafeProtocol = {
javascript: true,
Expand Down Expand Up @@ -293,12 +292,8 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
if (result !== undefined) rest = result;
}

if (this.hostname.length > hostnameMaxLen) {
this.hostname = '';
} else {
// hostnames are always lower case.
this.hostname = this.hostname.toLowerCase();
}
// hostnames are always lower case.
this.hostname = this.hostname.toLowerCase();

if (!ipv6Hostname) {
// IDNA Support: Returns a punycoded representation of "domain".
Expand Down