Skip to content

Commit 8a6cd9a

Browse files
committed
feat: use uc hosts aligns with query region hosts by default
1 parent 3018775 commit 8a6cd9a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

qiniu/conf.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ Object.defineProperty(exports, 'QUERY_REGION_HOST', {
4444
QUERY_REGION_BACKUP_HOSTS = [];
4545
}
4646
});
47-
let UC_HOST = 'uc.qbox.me';
47+
let UC_BACKUP_HOSTS = QUERY_REGION_BACKUP_HOSTS.slice();
48+
let UC_HOST = QUERY_REGION_HOST;
4849
Object.defineProperty(exports, 'UC_HOST', {
4950
get: () => UC_HOST,
5051
set: v => {
5152
UC_HOST = v;
53+
UC_BACKUP_HOSTS = [];
5254
QUERY_REGION_HOST = v;
5355
QUERY_REGION_BACKUP_HOSTS = [];
5456
}
@@ -108,11 +110,10 @@ const Config = (function () {
108110
return this.ucEndpointsProvider;
109111
}
110112

111-
return new Endpoint(
112-
UC_HOST,
113-
{
113+
return new StaticEndpointsProvider(
114+
[UC_HOST].concat(UC_BACKUP_HOSTS).map(h => new Endpoint(h, {
114115
defaultScheme: this.useHttpsDomain ? 'https' : 'http'
115-
}
116+
}))
116117
);
117118
};
118119

0 commit comments

Comments
 (0)