-
Notifications
You must be signed in to change notification settings - Fork 516
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
added request validation for urls with and without ports #491
Conversation
expect(isValid).toBeTruthy(); | ||
}); | ||
|
||
it('should validate urls with credentials by adding port', () => { |
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.
This appears to be the same as the should validate urls with credentials
test.
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.
This one ensures standard ports are added to the URL for validation. Note the expected signatures of these two tests are different, but they both pass.
*/ | ||
function buildUrlWithStandardPort(parsedUrl) { | ||
let url = ''; | ||
const port = parsedUrl.protocol === 'https:' ? ':443' : ':80'; |
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.
Should add a case for the gopher protocol (:
https://nodejs.org/api/url.html#url_url_port
PR for DI-320
Fixes #411