File tree Expand file tree Collapse file tree 1 file changed +1
-38
lines changed
BitwardenShared/Core/Platform/Extensions Expand file tree Collapse file tree 1 file changed +1
-38
lines changed Original file line number Diff line number Diff line change @@ -12,33 +12,6 @@ extension URL {
1212 " (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$ "
1313 }
1414
15- /// Valid top-level domain values.
16- private var validTlds : [ String ] {
17- [
18- " .com " ,
19- " .net " ,
20- " .org " ,
21- " .edu " ,
22- " .uk " ,
23- " .gov " ,
24- " .ca " ,
25- " .de " ,
26- " .jp " ,
27- " .fr " ,
28- " .au " ,
29- " .ru " ,
30- " .ch " ,
31- " .io " ,
32- " .es " ,
33- " .us " ,
34- " .co " ,
35- " .xyz " ,
36- " .info " ,
37- " .ly " ,
38- " .mil " ,
39- ]
40- }
41-
4215 // MARK: Properties
4316
4417 /// If the URL is for an app using the Bitwarden `iosapp://` URL scheme, this returns the web
@@ -58,19 +31,9 @@ extension URL {
5831 return DomainName . parseBaseDomain ( url: self ) ?? host
5932 }
6033
61- /// Whether the URL's domain ends in an accepted top-level domain value.
62- var hasValidTld : Bool {
63- guard let host else { return false }
64-
65- for tld in validTlds where host. hasSuffix ( tld) {
66- return true
67- }
68- return false
69- }
70-
7134 /// Whether the URL has valid components that are in the correct order.
7235 var hasValidURLComponents : Bool {
73- guard absoluteString. isValidURL, hasValidTld else { return false }
36+ guard absoluteString. isValidURL else { return false }
7437 let scheme = scheme ?? " "
7538 let host = host ?? " "
7639
You can’t perform that action at this time.
0 commit comments