You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
t.Logf("WARNING: Failed to delete the test TableStore table %q. It has been left in your Alibaba Cloud account and may incur charges. (error was %s)", tableName, err)
252
252
}
253
253
}
254
+
255
+
funcTestGetHttpProxyUrl(t*testing.T) {
256
+
tests:= []struct {
257
+
namestring
258
+
rawUrlstring
259
+
httpProxystring
260
+
httpsProxystring
261
+
noProxystring
262
+
expectedProxyURLstring
263
+
}{
264
+
{
265
+
name: "should set proxy using http_proxy environment variable",
266
+
rawUrl: "http://example.com",
267
+
httpProxy: "http://foo.bar:3128",
268
+
httpsProxy: "https://secure.example.com",
269
+
noProxy: "",
270
+
expectedProxyURL: "http://foo.bar:3128",
271
+
},
272
+
{
273
+
name: "should set proxy using http_proxy environment variable",
274
+
rawUrl: "http://example.com",
275
+
httpProxy: "http://foo.barr",
276
+
httpsProxy: "https://secure.example.com",
277
+
noProxy: "",
278
+
expectedProxyURL: "http://foo.barr",
279
+
},
280
+
{
281
+
name: "should set proxy using https_proxy environment variable",
282
+
rawUrl: "https://secure.example.com",
283
+
httpProxy: "http://foo.bar",
284
+
httpsProxy: "https://foo.bar.com:3128",
285
+
noProxy: "",
286
+
expectedProxyURL: "https://foo.bar.com:3128",
287
+
},
288
+
{
289
+
name: "should set proxy using https_proxy environment variable",
290
+
rawUrl: "https://secure.example.com",
291
+
httpProxy: "",
292
+
httpsProxy: "http://foo.baz",
293
+
noProxy: "",
294
+
expectedProxyURL: "http://foo.baz",
295
+
},
296
+
{
297
+
name: "should not set http proxy if NO_PROXY contains the host",
298
+
rawUrl: "http://example.internal",
299
+
httpProxy: "http://foo.bar:3128",
300
+
httpsProxy: "",
301
+
noProxy: "example.internal",
302
+
expectedProxyURL: "",
303
+
},
304
+
{
305
+
name: "should not set HTTP proxy when NO_PROXY matches the domain with suffix",
306
+
rawUrl: "http://qqu.example.internal",
307
+
httpProxy: "http://foo.bar:3128",
308
+
httpsProxy: "",
309
+
noProxy: ".example.internal",
310
+
expectedProxyURL: "",
311
+
},
312
+
{
313
+
name: "should not set https proxy if NO_PROXY contains the host",
314
+
rawUrl: "https://secure.internal",
315
+
httpProxy: "",
316
+
httpsProxy: "https://foo.baz:3128",
317
+
noProxy: "secure.internal",
318
+
expectedProxyURL: "",
319
+
},
320
+
{
321
+
name: "should not set https proxy if NO_PROXY matches the domain with suffix",
0 commit comments