Skip to content
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

Merged
merged 4 commits into from
Oct 21, 2019
Merged

Conversation

eshanholtz
Copy link
Contributor

@eshanholtz eshanholtz commented Oct 18, 2019

PR for DI-320
Fixes #411

expect(isValid).toBeTruthy();
});

it('should validate urls with credentials by adding port', () => {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@eshanholtz eshanholtz merged commit edacd47 into master Oct 21, 2019
@eshanholtz eshanholtz deleted the di-320 branch October 21, 2019 18:21
*/
function buildUrlWithStandardPort(parsedUrl) {
let url = '';
const port = parsedUrl.protocol === 'https:' ? ':443' : ':80';
Copy link
Contributor

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

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.

validateExpressRequest as documented works with twiml but not event callbacks
3 participants