-
Notifications
You must be signed in to change notification settings - Fork 134
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
Krishna2323/issue/49286 #813
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
* @returns The formatted URL | ||
*/ | ||
sanitizeURL(url: string): string { | ||
sanitizeURL(url: string, scheme = 'https'): string { |
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.
sanitizeURL(url: string, scheme = 'https'): string { | |
sanitizeURL(url: string, defaultScheme = 'https'): string { |
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.
I think defaultScheme
is more meaningful because it uses only as a default value if the URL didn't have a scheme. We also need to update the comment and its usage.
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.
We can also add a unit to confirm that
expect(Str.sanitizeURL('https://example.com', 'http')).toBe('https://example.com');
@rlinoz I'll take over as I'm assigned to the parent issue |
Fixed Issues
$ GH_LINK Expensify/App#49286
Details: This PR updates the
sanitizeURL
utility function to accept a new parameter,scheme
. Thescheme
parameter allows us to specify the scheme as needed. The default value ishttps
, but we can passhttp
or any other scheme as the scheme parameter to override it.Tests
QA