@cloudbase/manager-node 4.1.2 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constant.js +1 -2
- package/lib/env/index.js +4 -2
- package/lib/storage/index.js +4 -2
- package/package.json +1 -1
- package/types/constant.d.ts +1 -1
package/lib/constant.js
CHANGED
|
@@ -51,5 +51,4 @@ exports.SCF_STATUS = {
|
|
|
51
51
|
};
|
|
52
52
|
// 是否使用内网域名
|
|
53
53
|
exports.USE_INTERNAL_ENDPOINT = "USE_INTERNAL_ENDPOINT" in process.env;
|
|
54
|
-
|
|
55
|
-
exports.COS_SDK_PROTOCOL = "COS_SDK_PROTOCOL";
|
|
54
|
+
exports.COS_SDK_PROTOCOL = process.env.COS_SDK_PROTOCOL;
|
package/lib/env/index.js
CHANGED
|
@@ -261,8 +261,10 @@ class EnvService {
|
|
|
261
261
|
SecurityToken: token,
|
|
262
262
|
Domain: constant_1.USE_INTERNAL_ENDPOINT ? "{Bucket}.cos-internal.{Region}.tencentcos.cn" /* INTERNAL */ : "{Bucket}.cos.{Region}.tencentcos.cn" /* PUBLIC */
|
|
263
263
|
};
|
|
264
|
-
if (constant_1.COS_SDK_PROTOCOL
|
|
265
|
-
cosConfig.Protocol =
|
|
264
|
+
if (constant_1.COS_SDK_PROTOCOL) {
|
|
265
|
+
cosConfig.Protocol = constant_1.COS_SDK_PROTOCOL.endsWith(':')
|
|
266
|
+
? constant_1.COS_SDK_PROTOCOL.toLowerCase()
|
|
267
|
+
: constant_1.COS_SDK_PROTOCOL.toLowerCase() + ':';
|
|
266
268
|
}
|
|
267
269
|
return new cos_nodejs_sdk_v5_1.default(cosConfig);
|
|
268
270
|
}
|
package/lib/storage/index.js
CHANGED
|
@@ -848,8 +848,10 @@ class StorageService {
|
|
|
848
848
|
SecurityToken: token,
|
|
849
849
|
Domain: constant_1.USE_INTERNAL_ENDPOINT ? "{Bucket}.cos-internal.{Region}.tencentcos.cn" /* INTERNAL */ : "{Bucket}.cos.{Region}.tencentcos.cn" /* PUBLIC */
|
|
850
850
|
};
|
|
851
|
-
if (constant_1.COS_SDK_PROTOCOL
|
|
852
|
-
cosConfig.Protocol =
|
|
851
|
+
if (constant_1.COS_SDK_PROTOCOL) {
|
|
852
|
+
cosConfig.Protocol = constant_1.COS_SDK_PROTOCOL.endsWith(':')
|
|
853
|
+
? constant_1.COS_SDK_PROTOCOL.toLowerCase()
|
|
854
|
+
: constant_1.COS_SDK_PROTOCOL.toLowerCase() + ':';
|
|
853
855
|
}
|
|
854
856
|
return new cos_nodejs_sdk_v5_1.default(cosConfig);
|
|
855
857
|
}
|
package/package.json
CHANGED
package/types/constant.d.ts
CHANGED
|
@@ -40,4 +40,4 @@ export declare const enum COS_ENDPOINT {
|
|
|
40
40
|
INTERNAL = "{Bucket}.cos-internal.{Region}.tencentcos.cn",
|
|
41
41
|
PUBLIC = "{Bucket}.cos.{Region}.tencentcos.cn"
|
|
42
42
|
}
|
|
43
|
-
export declare const COS_SDK_PROTOCOL
|
|
43
|
+
export declare const COS_SDK_PROTOCOL: string;
|