@@ -7212,7 +7212,7 @@ module.exports = function(module) {
7212
7212
/*! exports provided: name, version, description, main, types, scripts, repository, keywords, author, license, bugs, homepage, dependencies, devDependencies, default */
7213
7213
/***/ ( function ( module ) {
7214
7214
7215
- module . exports = JSON . parse ( "{\"name\":\"cos-js-sdk-v5\",\"version\":\"1.4.8\",\"description\":\"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)\",\"main\":\"dist/cos-js-sdk-v5.js\",\"types\":\"index.d.ts\",\"scripts\":{\"server\":\"node server/sts.js\",\"dev\":\"cross-env NODE_ENV=development webpack -w --mode=development\",\"build\":\"cross-env NODE_ENV=production webpack --mode=production\",\"cos-auth.min.js\":\"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/tencentyun/cos-js-sdk-v5.git\"},\"keywords\":[],\"author\":\"carsonxu\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/tencentyun/cos-js-sdk-v5/issues\"},\"homepage\":\"https://github.com/tencentyun/cos-js-sdk-v5#readme\",\"dependencies\":{\"@xmldom/xmldom\":\"^0.8.2\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/plugin-transform-runtime\":\"7.18.10\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^5.2.0\",\"express\":\"^4.16.4\",\"qcloud-cos-sts\":\"^3.0.2\",\"request\":\"^2.87.0\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}" ) ;
7215
+ module . exports = JSON . parse ( "{\"name\":\"cos-js-sdk-v5\",\"version\":\"1.4.9\",\"description\":\"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)\",\"main\":\"dist/cos-js-sdk-v5.js\",\"types\":\"index.d.ts\",\"scripts\":{\"server\":\"node server/sts.js\",\"dev\":\"cross-env NODE_ENV=development webpack -w --mode=development\",\"build\":\"cross-env NODE_ENV=production webpack --mode=production\",\"cos-auth.min.js\":\"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m\"},\"repository\":{\"type\":\"git\",\"url\":\"git+https://github.com/tencentyun/cos-js-sdk-v5.git\"},\"keywords\":[],\"author\":\"carsonxu\",\"license\":\"ISC\",\"bugs\":{\"url\":\"https://github.com/tencentyun/cos-js-sdk-v5/issues\"},\"homepage\":\"https://github.com/tencentyun/cos-js-sdk-v5#readme\",\"dependencies\":{\"@xmldom/xmldom\":\"^0.8.2\"},\"devDependencies\":{\"@babel/core\":\"7.17.9\",\"@babel/plugin-transform-runtime\":\"7.18.10\",\"@babel/preset-env\":\"7.16.11\",\"babel-loader\":\"8.2.5\",\"body-parser\":\"^1.18.3\",\"cross-env\":\"^5.2.0\",\"express\":\"^4.16.4\",\"qcloud-cos-sts\":\"^3.0.2\",\"request\":\"^2.87.0\",\"terser-webpack-plugin\":\"4.2.3\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"4.10.0\"}}" ) ;
7216
7216
7217
7217
/***/ } ) ,
7218
7218
@@ -11087,9 +11087,9 @@ function putObjectCopy(params, callback) {
11087
11087
return ;
11088
11088
}
11089
11089
11090
- var SourceBucket = m [ 1 ] ;
11091
- var SourceRegion = m [ 3 ] ;
11092
- var SourceKey = decodeURIComponent ( m [ 4 ] ) ;
11090
+ var SourceBucket = m . Bucket ;
11091
+ var SourceRegion = m . Region ;
11092
+ var SourceKey = decodeURIComponent ( m . Key ) ;
11093
11093
submitRequest . call ( this , {
11094
11094
Scope : [ {
11095
11095
action : 'name/cos:GetObject' ,
@@ -11138,9 +11138,9 @@ function uploadPartCopy(params, callback) {
11138
11138
return ;
11139
11139
}
11140
11140
11141
- var SourceBucket = m [ 1 ] ;
11142
- var SourceRegion = m [ 3 ] ;
11143
- var SourceKey = decodeURIComponent ( m [ 4 ] ) ;
11141
+ var SourceBucket = m . Bucket ;
11142
+ var SourceRegion = m . Region ;
11143
+ var SourceKey = decodeURIComponent ( m . Key ) ;
11144
11144
submitRequest . call ( this , {
11145
11145
Scope : [ {
11146
11146
action : 'name/cos:GetObject' ,
@@ -12130,6 +12130,11 @@ function getUrl(params) {
12130
12130
Bucket : longBucket ,
12131
12131
Region : region
12132
12132
} ) ;
12133
+ } // 兼容不带冒号的http、https
12134
+
12135
+
12136
+ if ( [ 'http' , 'https' ] . includes ( params . protocol ) ) {
12137
+ params . protocol = params . protocol + ':' ;
12133
12138
}
12134
12139
12135
12140
var protocol = params . protocol || ( util . isBrowser && location . protocol === 'http:' ? 'http:' : 'https:' ) ;
@@ -12550,7 +12555,8 @@ function _submitRequest(params, callback) {
12550
12555
} ) ;
12551
12556
12552
12557
if ( params . action ) {
12553
- url = url + '?' + params . action ;
12558
+ // 已知问题,某些版本的qq会对url自动拼接(比如/upload被拼接成/upload=(null))导致签名错误,这里做下兼容。
12559
+ url = url + '?' + ( util . isIOS_QQ ? "" . concat ( params . action , "=" ) : params . action ) ;
12554
12560
}
12555
12561
12556
12562
if ( params . qsStr ) {
@@ -13462,12 +13468,13 @@ var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "./node_m
13462
13468
13463
13469
var pkg = __webpack_require__ ( /*! ../package.json */ "./package.json" ) ;
13464
13470
13465
- var BeaconAction = __webpack_require__ ( /*! ../lib/beacon.min */ "./lib/beacon.min.js" ) ;
13466
-
13467
13471
var beacon = null ;
13468
13472
13469
13473
var getBeacon = function getBeacon ( delay ) {
13470
13474
if ( ! beacon ) {
13475
+ // 不放在顶层是避免首次引入就被加载,从而避免在某些环境比如webworker里加载灯塔sdk内window相关对象报错
13476
+ var BeaconAction = __webpack_require__ ( /*! ../lib/beacon.min */ "./lib/beacon.min.js" ) ;
13477
+
13471
13478
beacon = new BeaconAction ( {
13472
13479
appkey : "0AND0VEVB24UBGDU" ,
13473
13480
versionCode : pkg . version ,
@@ -14112,12 +14119,12 @@ var parseSelectPayload = function parseSelectPayload(chunk) {
14112
14119
var getSourceParams = function getSourceParams ( source ) {
14113
14120
var parser = this . options . CopySourceParser ;
14114
14121
if ( parser ) return parser ( source ) ;
14115
- var m = source . match ( / ^ ( [ ^ . ] + - \d + ) \. c o s ( v 6 | - c d c ) ? \. ( [ ^ . ] + ) \. m y q c l o u d \. c o m \/ ( .+ ) $ / ) ;
14122
+ var m = source . match ( / ^ ( [ ^ . ] + - \d + ) \. c o s ( v 6 | - c d c | - i n t e r n a l ) ? \. ( [ ^ . ] + ) \. ( ( m y q c l o u d \. c o m ) | ( t e n c e n t c o s \. c n ) ) \/ ( .+ ) $ / ) ;
14116
14123
if ( ! m ) return null ;
14117
14124
return {
14118
14125
Bucket : m [ 1 ] ,
14119
14126
Region : m [ 3 ] ,
14120
- Key : m [ 4 ]
14127
+ Key : m [ 7 ]
14121
14128
} ;
14122
14129
} ;
14123
14130
@@ -14584,7 +14591,7 @@ var apiWrapper = function apiWrapper(apiName, apiFn) {
14584
14591
} ;
14585
14592
14586
14593
var errMsg = checkParams ( ) ;
14587
- var isSync = apiName === 'getAuth' || apiName === 'getObjectUrl' ;
14594
+ var isSync = apiName === 'getAuth' ;
14588
14595
14589
14596
if ( typeof Promise === 'function' && ! isSync && ! callback ) {
14590
14597
return new Promise ( function ( resolve , reject ) {
@@ -14725,7 +14732,28 @@ var isNode = function isNode() {
14725
14732
14726
14733
var isCIHost = function isCIHost ( url ) {
14727
14734
return / ^ h t t p s ? : \/ \/ ( [ ^ / ] + \. ) ? c i \. [ ^ / ] + / . test ( url ) ;
14728
- } ;
14735
+ } ; //判断是否是ios
14736
+
14737
+
14738
+ var isIOS = function ( ) {
14739
+ if ( ( typeof navigator === "undefined" ? "undefined" : _typeof ( navigator ) ) !== 'object' ) {
14740
+ return false ;
14741
+ }
14742
+
14743
+ var u = navigator . userAgent ;
14744
+ var isIOS = ! ! u . match ( / \( i [ ^ ; ] + ; ( U ; ) ? C P U .+ M a c O S X / ) ; //ios终端
14745
+
14746
+ return isIOS ;
14747
+ } ( ) ; // 判断是qq内置浏览器
14748
+
14749
+
14750
+ var isQQ = function ( ) {
14751
+ if ( ( typeof navigator === "undefined" ? "undefined" : _typeof ( navigator ) ) !== 'object' ) {
14752
+ return false ;
14753
+ }
14754
+
14755
+ return / \s Q Q / i. test ( navigator . userAgent ) ;
14756
+ } ( ) ;
14729
14757
14730
14758
var util = {
14731
14759
noop : noop ,
@@ -14760,7 +14788,8 @@ var util = {
14760
14788
getSourceParams : getSourceParams ,
14761
14789
isBrowser : true ,
14762
14790
isNode : isNode ,
14763
- isCIHost : isCIHost
14791
+ isCIHost : isCIHost ,
14792
+ isIOS_QQ : isIOS && isQQ
14764
14793
} ;
14765
14794
module . exports = util ;
14766
14795
/* WEBPACK VAR INJECTION */ } . call ( this , __webpack_require__ ( /*! ./../node_modules/process/browser.js */ "./node_modules/process/browser.js" ) ) )
0 commit comments