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

android: make custom url check case-insensitive #513

Merged
merged 1 commit into from
Sep 19, 2024
Merged

android: make custom url check case-insensitive #513

merged 1 commit into from
Sep 19, 2024

Conversation

kari-ts
Copy link
Collaborator

@kari-ts kari-ts commented Sep 18, 2024

Fixes tailscale/corp#23210

@@ -36,7 +36,9 @@ class LoginWithCustomControlURLViewModel : CustomLoginViewModel() {
// localAPIClient will use the default server if we give it a broken URL,
// but we can make sure we can construct a URL from the input string and
// ensure it has an http/https scheme
when (urlStr.startsWith("http") && urlStr.contains("://") && urlStr.length > 7) {
when (urlStr.startsWith("http", ignoreCase = true) &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checking - will Http:// work though? (on all browsers?)

I probably copied this from Apple, where it does not. If it doesn't, we could be nice and just lowercase the scheme for them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if it's possible, modify the input field so it doesn't auto-capitalize

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked for me. I like this suggestion, done!

Fixes tailscale/corp#23210

Signed-off-by: kari-ts <kari@tailscale.com>
@kari-ts kari-ts merged commit 22de0cd into main Sep 19, 2024
4 checks passed
@kari-ts kari-ts deleted the kari/Http branch September 19, 2024 20:25
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.

3 participants