From c88774c7efb83964ae8d21f30d7f2412668f9f68 Mon Sep 17 00:00:00 2001 From: chrisftian Date: Thu, 18 Nov 2021 15:13:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9ACIHost=E5=85=BC=E5=AE=B9=E5=A4=84?= =?UTF-8?q?=E7=90=86=20(#56)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: chrisftian --- demo-album/lib/cos-wx-sdk-v5.js | 7 ++----- demo/lib/cos-wx-sdk-v5.js | 7 ++----- package.json | 2 +- src/cos.js | 2 +- src/util.js | 5 +---- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/demo-album/lib/cos-wx-sdk-v5.js b/demo-album/lib/cos-wx-sdk-v5.js index 410667b..69be5ba 100644 --- a/demo-album/lib/cos-wx-sdk-v5.js +++ b/demo-album/lib/cos-wx-sdk-v5.js @@ -630,10 +630,7 @@ var canFileSlice = (function () { })(); var isCIHost = function(url) { - if (url && url.split('?')[0].match(/(.ci.|ci.|.ci)/g)) { - return true; - } - return false; + return /^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(url); } var util = { @@ -2347,7 +2344,7 @@ base.init(COS, task); advance.init(COS, task); COS.getAuthorization = util.getAuth; -COS.version = '1.1.0'; +COS.version = '1.1.1'; module.exports = COS; diff --git a/demo/lib/cos-wx-sdk-v5.js b/demo/lib/cos-wx-sdk-v5.js index 410667b..69be5ba 100644 --- a/demo/lib/cos-wx-sdk-v5.js +++ b/demo/lib/cos-wx-sdk-v5.js @@ -630,10 +630,7 @@ var canFileSlice = (function () { })(); var isCIHost = function(url) { - if (url && url.split('?')[0].match(/(.ci.|ci.|.ci)/g)) { - return true; - } - return false; + return /^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(url); } var util = { @@ -2347,7 +2344,7 @@ base.init(COS, task); advance.init(COS, task); COS.getAuthorization = util.getAuth; -COS.version = '1.1.0'; +COS.version = '1.1.1'; module.exports = COS; diff --git a/package.json b/package.json index 006da04..d04fd57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cos-wx-sdk-v5", - "version": "1.1.0", + "version": "1.1.1", "description": "小程序 SDK for [腾讯云对象存储服务](https://cloud.tencent.com/product/cos)", "main": "demo/lib/cos-wx-sdk-v5.js", "scripts": { diff --git a/src/cos.js b/src/cos.js index adc6a3f..a43fbd1 100644 --- a/src/cos.js +++ b/src/cos.js @@ -57,6 +57,6 @@ base.init(COS, task); advance.init(COS, task); COS.getAuthorization = util.getAuth; -COS.version = '1.1.0'; +COS.version = '1.1.1'; module.exports = COS; diff --git a/src/util.js b/src/util.js index b8d20da..b21f6f5 100644 --- a/src/util.js +++ b/src/util.js @@ -550,10 +550,7 @@ var canFileSlice = (function () { })(); var isCIHost = function(url) { - if (url && url.split('?')[0].match(/(.ci.|ci.|.ci)/g)) { - return true; - } - return false; + return /^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(url); } var util = {