Skip to content

Commit 81c2a70

Browse files
committed
remove the prefop host detection code
1 parent d427958 commit 81c2a70

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

qiniu/fop.js

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,28 +85,11 @@ function pfopReq(mac, config, reqParams, callbackFunc) {
8585
// @param persistentId
8686
// @callbackFunc(err, respBody, respInfo) - 回调函数
8787
OperationManager.prototype.prefop = function(persistentId, callbackFunc) {
88-
var apiHost = "http://api.qiniu.com";
89-
var zoneIndex = persistentId.indexOf(".");
90-
if (zoneIndex == -1) {
91-
callbackFunc("invalid persistentId", null, null);
92-
return;
88+
var apiHost = "api.qiniu.com";
89+
if(this.config.zone) {
90+
apiHost=this.config.zone.apiHost;
9391
}
94-
var zoneTag = persistentId.substring(0, zoneIndex);
95-
switch (zoneTag) {
96-
case "z1":
97-
apiHost = "api-z1.qiniu.com";
98-
break;
99-
case "z2":
100-
apiHost = "api-z2.qiniu.com";
101-
break;
102-
case "na0":
103-
apiHost = "api-na0.qiniu.com";
104-
break;
105-
default:
106-
apiHost = "api.qiniu.com";
107-
break;
108-
}
109-
92+
11093
var scheme = this.config.useHttpsDomain ? "https://" : "http://";
11194
var requestURI = scheme + apiHost + "/status/get/prefop";
11295
var reqParams = {

0 commit comments

Comments
 (0)