From 5ca063bc6f60d04b76351958a697f2126535b226 Mon Sep 17 00:00:00 2001 From: pengxing Date: Tue, 30 Jun 2020 20:31:26 +0800 Subject: [PATCH] =?UTF-8?q?fix=20726=20=E6=B7=BB=E5=8A=A0=20wss=3F=20?= =?UTF-8?q?=E5=92=8C=20taf=20=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8D=8F=E8=AE=AE?= =?UTF-8?q?=E7=9A=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/api.ts b/src/utils/api.ts index cb86c439b..bfc0e57d9 100644 --- a/src/utils/api.ts +++ b/src/utils/api.ts @@ -253,7 +253,10 @@ export function isApiOutdated( } export function isValidApi(api: string) { - return api && /^(?:https?:\/\/[^\/]+)?(\/[^\s\/\?]*){1,}(\?.*)?$/.test(api); + return ( + api && + /^(?:(https?|wss?|taf):\/\/[^\/]+)?(\/[^\s\/\?]*){1,}(\?.*)?$/.test(api) + ); } export function isEffectiveApi(