Merge pull request #728 from PengXing/master

fix-726 支持自定义请求协议
This commit is contained in:
liaoxuezhi 2020-06-30 20:43:55 +08:00 committed by GitHub
commit 2cf37d6f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(