@@ -16,11 +16,15 @@ public class Config
16
16
/// </summary>
17
17
public static string DefaultUcHost = "uc.qbox.me" ;
18
18
/// <summary>
19
- /// 默认备用空间管理域名
19
+ /// 默认查询区域域名
20
20
/// </summary>
21
- public static List < string > DefaultBackupUcHosts = new List < string >
21
+ public static string DefaultQueryRegionHost = "kodo-config.qiniuapi.com" ;
22
+ /// <summary>
23
+ /// 默认备用查询区域域名
24
+ /// </summary>
25
+ public static List < string > DefaultBackupQueryRegionHosts = new List < string >
22
26
{
23
- "kodo-config.qiniuapi.com " ,
27
+ "uc.qbox.me " ,
24
28
"api.qiniu.com"
25
29
} ;
26
30
@@ -68,12 +72,15 @@ public class Config
68
72
69
73
private string _ucHost = DefaultUcHost ;
70
74
71
- private List < string > _backupUcHosts = DefaultBackupUcHosts ;
75
+ private string _queryRegionHost = DefaultQueryRegionHost ;
76
+
77
+ private List < string > _backupQueryRegionHosts = DefaultBackupQueryRegionHosts ;
72
78
73
79
public void SetUcHost ( string val )
74
80
{
75
81
_ucHost = val ;
76
- _backupUcHosts . Clear ( ) ;
82
+ _queryRegionHost = val ;
83
+ _backupQueryRegionHosts . Clear ( ) ;
77
84
}
78
85
79
86
public string UcHost ( )
@@ -82,14 +89,26 @@ public string UcHost()
82
89
return string . Format ( "{0}{1}" , scheme , _ucHost ) ;
83
90
}
84
91
85
- public void SetBackupUcHost ( List < string > val )
92
+ public void SetQueryRegionHost ( string val )
93
+ {
94
+ _queryRegionHost = val ;
95
+ _backupQueryRegionHosts . Clear ( ) ;
96
+ }
97
+
98
+ public string QueryRegionHost ( )
99
+ {
100
+ string scheme = UseHttps ? "https://" : "http://" ;
101
+ return string . Format ( "{0}{1}" , scheme , _queryRegionHost ) ;
102
+ }
103
+
104
+ public void SetBackupQueryRegionHosts ( List < string > val )
86
105
{
87
- _backupUcHosts = val ;
106
+ _backupQueryRegionHosts = val ;
88
107
}
89
108
90
- public List < string > BackupUcHost ( )
109
+ public List < string > BackupQueryRegionHosts ( )
91
110
{
92
- return _backupUcHosts ;
111
+ return _backupQueryRegionHosts ;
93
112
}
94
113
95
114
/// <summary>
@@ -104,7 +123,7 @@ public string RsHost(string ak, string bucket)
104
123
Zone z = this . Zone ;
105
124
if ( z == null )
106
125
{
107
- z = ZoneHelper . QueryZone ( ak , bucket , UcHost ( ) , BackupUcHost ( ) ) ;
126
+ z = ZoneHelper . QueryZone ( ak , bucket , QueryRegionHost ( ) , BackupQueryRegionHosts ( ) ) ;
108
127
}
109
128
return string . Format ( "{0}{1}" , scheme , z . RsHost ) ;
110
129
}
@@ -121,7 +140,7 @@ public string RsfHost(string ak, string bucket)
121
140
Zone z = this . Zone ;
122
141
if ( z == null )
123
142
{
124
- z = ZoneHelper . QueryZone ( ak , bucket , UcHost ( ) , BackupUcHost ( ) ) ;
143
+ z = ZoneHelper . QueryZone ( ak , bucket , QueryRegionHost ( ) , BackupQueryRegionHosts ( ) ) ;
125
144
}
126
145
return string . Format ( "{0}{1}" , scheme , z . RsfHost ) ;
127
146
}
@@ -138,7 +157,7 @@ public string ApiHost(string ak, string bucket)
138
157
Zone z = this . Zone ;
139
158
if ( z == null )
140
159
{
141
- z = ZoneHelper . QueryZone ( ak , bucket , UcHost ( ) , BackupUcHost ( ) ) ;
160
+ z = ZoneHelper . QueryZone ( ak , bucket , QueryRegionHost ( ) , BackupQueryRegionHosts ( ) ) ;
142
161
}
143
162
return string . Format ( "{0}{1}" , scheme , z . ApiHost ) ;
144
163
}
@@ -155,7 +174,7 @@ public string IovipHost(string ak, string bucket)
155
174
Zone z = this . Zone ;
156
175
if ( z == null )
157
176
{
158
- z = ZoneHelper . QueryZone ( ak , bucket , UcHost ( ) , BackupUcHost ( ) ) ;
177
+ z = ZoneHelper . QueryZone ( ak , bucket , QueryRegionHost ( ) , BackupQueryRegionHosts ( ) ) ;
159
178
}
160
179
return string . Format ( "{0}{1}" , scheme , z . IovipHost ) ;
161
180
}
@@ -172,7 +191,7 @@ public string UpHost(string ak, string bucket)
172
191
Zone z = this . Zone ;
173
192
if ( z == null )
174
193
{
175
- z = ZoneHelper . QueryZone ( ak , bucket , UcHost ( ) , BackupUcHost ( ) ) ;
194
+ z = ZoneHelper . QueryZone ( ak , bucket , QueryRegionHost ( ) , BackupQueryRegionHosts ( ) ) ;
176
195
}
177
196
string upHost = z . SrcUpHosts [ 0 ] ;
178
197
if ( this . UseCdnDomains )
0 commit comments