From 7f5cad38ecc86e95c11cdce5e4c9b6a7a0b71a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E4=BC=9F?= <366193849@qq.com> Date: Tue, 20 Jul 2021 09:50:27 +0800 Subject: [PATCH] =?UTF-8?q?null=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.ReverseProxy/HttpClientHanlder.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/FastGithub.ReverseProxy/HttpClientHanlder.cs b/FastGithub.ReverseProxy/HttpClientHanlder.cs index 6301c26..1a18de7 100644 --- a/FastGithub.ReverseProxy/HttpClientHanlder.cs +++ b/FastGithub.ReverseProxy/HttpClientHanlder.cs @@ -94,10 +94,13 @@ namespace FastGithub.ReverseProxy { if (subject is IList list) { - var type = (int)list[0]!; - if (type == 2) // DNS + if (list.Count >= 2 && list[0] is int nameType && nameType == 2) { - yield return list[list.Count - 1]!.ToString()!; + var dnsName = list[1]?.ToString(); + if(dnsName!=null) + { + yield return dnsName; + } } } }