From 19db6388dbca9a11c507b215606886e204ce8823 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=80=81=E4=B9=9D?= <366193849@qq.com>
Date: Sun, 19 Sep 2021 14:53:16 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9pac?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
FastGithub.HttpServer/HttpProxyMiddleware.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/FastGithub.HttpServer/HttpProxyMiddleware.cs b/FastGithub.HttpServer/HttpProxyMiddleware.cs
index fae6ebd..ba5bdf0 100644
--- a/FastGithub.HttpServer/HttpProxyMiddleware.cs
+++ b/FastGithub.HttpServer/HttpProxyMiddleware.cs
@@ -99,7 +99,7 @@ namespace FastGithub.HttpServer
{
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;
}
@@ -107,16 +107,16 @@ namespace FastGithub.HttpServer
///
/// 创建proxypac脚本
///
- ///
+ ///
///
- private string CreateProxyPac(HostString host)
+ private string CreateProxyPac(HostString proxyHost)
{
var buidler = new StringBuilder();
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())
{
- buidler.AppendLine($" if (shExpMatch(host, '{domain}')) return proxy;");
+ buidler.AppendLine($" if (shExpMatch(host, '{domain}')) return fastgithub;");
}
buidler.AppendLine(" return 'DIRECT';");
buidler.AppendLine("}");