From c05285a7df4ad33bcc7dd4687f7680ab9290f537 Mon Sep 17 00:00:00 2001 From: zqlovejyc <943620963@qq.com> Date: Sat, 23 Jan 2021 22:24:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZqUtils.Core/Helpers/HttpHelper.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ZqUtils.Core/Helpers/HttpHelper.cs b/ZqUtils.Core/Helpers/HttpHelper.cs index df3230e..1521e26 100644 --- a/ZqUtils.Core/Helpers/HttpHelper.cs +++ b/ZqUtils.Core/Helpers/HttpHelper.cs @@ -988,16 +988,22 @@ public string RedirectUrl { var baseurl = Header["location"].ToString().Trim(); var locationurl = baseurl.ToLower(); + if (!string.IsNullOrEmpty(locationurl)) { var b = locationurl.StartsWith("http://") || locationurl.StartsWith("https://"); - if (!b) baseurl = new Uri(new Uri(ResponseUri), baseurl).AbsoluteUri; + if (!b) + baseurl = new Uri(new Uri(ResponseUri), baseurl).AbsoluteUri; } + return baseurl; } } } - catch { } + catch + { + } + return string.Empty; } }