Fix: wrong usage of URL.protocol
This commit is contained in:
parent
732138e745
commit
b85a1dc90a
@ -57,11 +57,11 @@ function _validUrl (s: string, constraints: URLConstraints): boolean {
|
||||
|
||||
if (constraints.protocol) {
|
||||
if (constraints.protocol === 'http.') {
|
||||
if (url.protocol !== 'https' && url.protocol !== 'http') {
|
||||
if (url.protocol !== 'https:' && url.protocol !== 'http:') {
|
||||
return false
|
||||
}
|
||||
} else if (constraints.protocol === 'ws.') {
|
||||
if (url.protocol !== 'wss' && url.protocol !== 'ws') {
|
||||
if (url.protocol !== 'wss:' && url.protocol !== 'ws:') {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user