Fix proxy for github update

This commit is contained in:
bao-qian
2016-05-09 23:51:10 +01:00
parent 3f709cc39e
commit 21aa31f963
2 changed files with 7 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ namespace Wox.Infrastructure.Http
{
public static class HttpRequest
{
private static WebProxy GetWebProxy(IHttpProxy proxy)
public static WebProxy WebProxy(IHttpProxy proxy)
{
if (proxy != null && proxy.Enabled && !string.IsNullOrEmpty(proxy.Server))
{
@@ -43,7 +43,7 @@ namespace Wox.Infrastructure.Http
HttpWebRequest request = WebRequest.CreateHttp(url);
request.Method = "GET";
request.Timeout = 10 * 1000;
request.Proxy = GetWebProxy(proxy);
request.Proxy = WebProxy(proxy);
request.UserAgent = @"Mozilla/5.0 (Trident/7.0; rv:11.0) like Gecko";
HttpWebResponse response;
try