老九 3 سال پیش
والد
کامیت
19db6388db
1فایلهای تغییر یافته به همراه5 افزوده شده و 5 حذف شده
  1. 5 5
      FastGithub.HttpServer/HttpProxyMiddleware.cs

+ 5 - 5
FastGithub.HttpServer/HttpProxyMiddleware.cs

@@ -99,7 +99,7 @@ namespace FastGithub.HttpServer
         {
         {
             if (host.Host == LOOPBACK || host.Host == LOCALHOST)
             if (host.Host == LOOPBACK || host.Host == LOCALHOST)
             {
             {
-                return host.Port == null || host.Port == this.options.Value.HttpProxyPort;
+                return host.Port == this.options.Value.HttpProxyPort;
             }
             }
             return false;
             return false;
         }
         }
@@ -107,16 +107,16 @@ namespace FastGithub.HttpServer
         /// <summary>
         /// <summary>
         /// 创建proxypac脚本
         /// 创建proxypac脚本
         /// </summary>
         /// </summary>
-        /// <param name="host"></param>
+        /// <param name="proxyHost"></param>
         /// <returns></returns>
         /// <returns></returns>
-        private string CreateProxyPac(HostString host)
+        private string CreateProxyPac(HostString proxyHost)
         {
         {
             var buidler = new StringBuilder();
             var buidler = new StringBuilder();
             buidler.AppendLine("function FindProxyForURL(url, host){");
             buidler.AppendLine("function FindProxyForURL(url, host){");
-            buidler.AppendLine($"    var proxy = 'PROXY {host}';");
+            buidler.AppendLine($"    var fastgithub = 'PROXY {proxyHost}';");
             foreach (var domain in this.fastGithubConfig.GetDomainPatterns())
             foreach (var domain in this.fastGithubConfig.GetDomainPatterns())
             {
             {
-                buidler.AppendLine($"    if (shExpMatch(host, '{domain}')) return proxy;");
+                buidler.AppendLine($"    if (shExpMatch(host, '{domain}')) return fastgithub;");
             }
             }
             buidler.AppendLine("    return 'DIRECT';");
             buidler.AppendLine("    return 'DIRECT';");
             buidler.AppendLine("}");
             buidler.AppendLine("}");