@alicloud/alfa-core 1.5.0-alpha.4 → 1.5.0-alpha.5
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.
|
@@ -21,10 +21,13 @@ function _requestInterceptor() {
|
|
|
21
21
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
22
22
|
while (1) switch (_context.prev = _context.next) {
|
|
23
23
|
case 0:
|
|
24
|
-
hostname = getCurrentCdnHost();
|
|
25
|
-
if (hostname
|
|
26
|
-
//
|
|
27
|
-
|
|
24
|
+
hostname = getCurrentCdnHost();
|
|
25
|
+
if (hostname !== 'alicdn.com') {
|
|
26
|
+
// if cdn is not alicdn, replace it
|
|
27
|
+
if (hostname && config.url) {
|
|
28
|
+
// 非公有云下无 cws2
|
|
29
|
+
config.url = config.url.replace(new RegExp('.alicdn.com'), ".".concat(hostname)).replace('cws2.', 'cws.');
|
|
30
|
+
}
|
|
28
31
|
}
|
|
29
32
|
return _context.abrupt("return", config);
|
|
30
33
|
case 3:
|
|
@@ -28,10 +28,13 @@ function _requestInterceptor() {
|
|
|
28
28
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
|
30
30
|
case 0:
|
|
31
|
-
hostname = getCurrentCdnHost();
|
|
32
|
-
if (hostname
|
|
33
|
-
//
|
|
34
|
-
|
|
31
|
+
hostname = getCurrentCdnHost();
|
|
32
|
+
if (hostname !== 'alicdn.com') {
|
|
33
|
+
// if cdn is not alicdn, replace it
|
|
34
|
+
if (hostname && config.url) {
|
|
35
|
+
// 非公有云下无 cws2
|
|
36
|
+
config.url = config.url.replace(new RegExp('.alicdn.com'), ".".concat(hostname)).replace('cws2.', 'cws.');
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
return _context.abrupt("return", config);
|
|
37
40
|
case 3:
|