mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-15 01:25:00 +03:00
fix(url): keep capitalized mailto: and tel: links as they are (#7052)
EnsureURLScheme matched the mailto: and tel: prefixes case-sensitively, so a support link typed as Mailto: or TEL: (phone keyboards capitalize the first letter) got https:// prepended and opened a broken web page. URL schemes are case-insensitive, and the check now is too.
This commit is contained in:
@@ -18,6 +18,8 @@ func TestEnsureURLScheme(t *testing.T) {
|
||||
{"mailto", "mailto:support@example.com", "mailto:support@example.com"},
|
||||
{"tel", "tel:+1234567890", "tel:+1234567890"},
|
||||
{"trims whitespace", " t.me/xui_support ", "https://t.me/xui_support"},
|
||||
{"capitalized mailto", "Mailto:support@example.com", "Mailto:support@example.com"},
|
||||
{"uppercase tel", "TEL:+1234567890", "TEL:+1234567890"},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user