简体   繁体   English

Nuget的安全开关在重定向之前显示空白的javascript页面

[英]Nuget's Security Switch shows blank javascript page before redirect

So I set up the Nuget plugin Security Switch 4.4.0 on my ASP.NET 4.5 site to set some pages as https and others as http. 因此,我在ASP.NET 4.5网站上设置了Nuget插件Security Switch 4.4.0,将某些页面设置为https,另一些页面设置为http。 This all works except that when switching between https pages and http pages there is a second where a blank white page is displayed with one line of javascript, before the redirect completes and the new page loads. 这一切都有效,除了在https页面和http页面之间切换时,在重定向完成和新页面加载之前,还有一秒钟会在其中显示空白的白页,其中包含一行javascript。

That javascript: 该javascript:

<html><head><title></title><script language="javascript">window.location = 'https://my-site.com/email-newsletter/';</script </head><body></body></html>

I see it is using the js to redirect the page but I'd really like if it didn't show this to the user. 我看到它正在使用js重定向页面,但是如果它没有向用户显示,我真的很想。 Is there any way to remove this effect? 有什么办法可以消除这种影响?

You can add a setting to the securitySwitch configuration element that will remove this feature. 您可以将设置添加到securitySwitch配置元素,以删除此功能。 This feature is disabled by default, so it sounds like you have this attribute explicitly set to "true" now. 默认情况下,此功能是禁用的,因此听起来您现在已将此属性明确设置为“ true”。 Changing it to "false" will likely result in most browsers warning users of the switch from HTTPS to HTTP. 将其更改为“ false”可能会导致大多数浏览器警告用户从HTTPS切换到HTTP。 There's not much else to do about it without the JS trick. 没有JS技巧,没有太多要做的事情了。

<securitySwitch bypassSecurityWarning="false">

Most browsers don't show the blank page you're seeing. 大多数浏览器不会显示您看到的空白页。 Which browser(s) are you seeing this behavior with? 您在哪个浏览器上看到此行为?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM