-
Notifications
You must be signed in to change notification settings - Fork 126
feat(arcgis-rest-request): change getDomainCredentials to handle URLs… #1211
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
feat(arcgis-rest-request): change getDomainCredentials to handle URLs… #1211
Conversation
… with mismatching cases
url = url.toLocaleLowerCase(); | ||
return this.trustedDomains.some((domainWithProtocol) => { | ||
return url.startsWith(domainWithProtocol); | ||
return url.startsWith(domainWithProtocol.toLocaleLowerCase()); |
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.
Are you using .toLocaleLowerCase()
(vs .toLowerCase
) intentionally here? I'm wondering what are the potential implications vs using .toLowerCase()
.
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.
Yes. I'd read a comment that toLowerCase
may not work properly for locales such as Turkish. I'll ask the translation team for advice.
String.prototype.toLocaleLowerCase():
Unlike other methods that use the locales argument, toLocaleLowerCase() does not allow locale matching. Therefore, after checking the validity of the locales argument, toLocaleLowerCase() always uses the first locale in the list (or the default locale if the list is empty), even if this locale is not supported by the implementation.
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.
For domain names (which we are checking here) should it really matter because the character set of so limited I think we can use toLowerCase()
here.
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.
Looks good to me.
… with mismatching cases
#1210