我试图强制页面在 SSL 下运行,所以我在 page_load 上实现了以下内容:
if (!Request.IsLocal && !Request.IsSecureConnection)
{
Response.Redirect(Helper.GetInstance().SSLBaseURL() + ScriptName());
}
由于某种原因,这最终陷入了循环。今天早些时候,我检查了 Request.Uri.Scheme,它解析为“http”,尽管我显然连接到https://www.domain.com/pagename.aspx。
您能想到为什么此页面未正确检测到我们在 https 下运行的任何原因吗?