-
Notifications
You must be signed in to change notification settings - Fork 39
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
auto correct uri option #296
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #296 +/- ##
==========================================
+ Coverage 80.21% 80.39% +0.18%
==========================================
Files 41 41
Lines 2128 2158 +30
Branches 474 485 +11
==========================================
+ Hits 1707 1735 +28
- Misses 407 409 +2
Partials 14 14 ☔ View full report in Codecov by Sentry. |
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.
few comments
if (!authority) { | ||
return true; | ||
} | ||
let is_ip; |
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.
Obviously I don't like this.
You could have used the Address4.IsValid static methods for this.
But since we only need to check /if/ it's an ip, we can just use this package - https://www.npmjs.com/package/is-ip, which has a very simple api.
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.
Address4.IsValid is deprected, and is-ip doesnt support browser. ended up using this module instead
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.
oops. thought you meant a different one
} | ||
|
||
isReservedHostname(clusterUrl: string): boolean { | ||
const parsedUrl = new URL(clusterUrl); |
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.
What happens if this fails? does it throw? will it throw further down the line?
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.
True, i need to add a try catch here. if it throws though (not a valid url), we consider it as not a reserved hostname right? ill just return false
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.
Update CHANGELOG.md
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #296 +/- ##
==========================================
+ Coverage 80.21% 80.39% +0.18%
==========================================
Files 41 41
Lines 2128 2158 +30
Branches 474 485 +11
==========================================
+ Hits 1707 1735 +28
- Misses 407 409 +2
Partials 14 14 ☔ View full report in Codecov by Sentry. |
Added
Changed
Fixed
Security