Skip to content

Commit

Permalink
fix:CIHost兼容处理 (#56)
Browse files Browse the repository at this point in the history
Co-authored-by: chrisftian <[email protected]>
  • Loading branch information
livehigh and livehigh authored Nov 18, 2021
1 parent 96d4679 commit c88774c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
7 changes: 2 additions & 5 deletions demo-album/lib/cos-wx-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;

Expand Down
7 changes: 2 additions & 5 deletions demo/lib/cos-wx-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/cos.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
5 changes: 1 addition & 4 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit c88774c

Please sign in to comment.