本文整理汇总了C#中System.Web.HttpContextBase.GetNWebsecOwinContext方法的典型用法代码示例。如果您正苦于以下问题:C# HttpContextBase.GetNWebsecOwinContext方法的具体用法?C# HttpContextBase.GetNWebsecOwinContext怎么用?C# HttpContextBase.GetNWebsecOwinContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.HttpContextBase
的用法示例。
在下文中一共展示了HttpContextBase.GetNWebsecOwinContext方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCspReportonlyConfiguration
private ICspConfiguration GetCspReportonlyConfiguration(HttpContextBase context)
{
var owinContext = context.GetNWebsecOwinContext();
if (owinContext != null && owinContext.CspReportOnly != null)
{
return owinContext.CspReportOnly;
}
return context.GetNWebsecContext().CspReportOnly;
}
示例2: GetXXssProtectionConfiguration
public IXXssProtectionConfiguration GetXXssProtectionConfiguration(HttpContextBase context)
{
var owinContext = context.GetNWebsecOwinContext();
if (owinContext != null && owinContext.XXssProtection != null)
{
return owinContext.XXssProtection;
}
return context.GetNWebsecContext().XXssProtection;
}
示例3: GetXDownloadOptionsConfiguration
public ISimpleBooleanConfiguration GetXDownloadOptionsConfiguration(HttpContextBase context)
{
var owinContext = context.GetNWebsecOwinContext();
if (owinContext != null && owinContext.XDownloadOptions != null)
{
return owinContext.XDownloadOptions;
}
return context.GetNWebsecContext().XDownloadOptions;
}
示例4: GetXFrameOptionsConfiguration
public IXFrameOptionsConfiguration GetXFrameOptionsConfiguration(HttpContextBase context)
{
var owinContext = context.GetNWebsecOwinContext();
if (owinContext != null && owinContext.XFrameOptions != null)
{
return owinContext.XFrameOptions;
}
return context.GetNWebsecContext().XFrameOptions;
}
示例5: GetXRobotsTagConfiguration
public IXRobotsTagConfiguration GetXRobotsTagConfiguration(HttpContextBase context)
{
var owinContext = context.GetNWebsecOwinContext();
if (owinContext != null && owinContext.XRobotsTag != null)
{
return owinContext.XRobotsTag;
}
return context.GetNWebsecContext().XRobotsTag;
}
示例6: GetCspConfiguration
public ICspConfiguration GetCspConfiguration(HttpContextBase context, bool reportOnly)
{
if (reportOnly)
{
return GetCspReportonlyConfiguration(context);
}
var owinContext = context.GetNWebsecOwinContext();
if (owinContext != null && owinContext.Csp != null)
{
return owinContext.Csp;
}
return context.GetNWebsecContext().Csp;
}
示例7: GetCspConfigurationOverride
public CspOverrideConfiguration GetCspConfigurationOverride(HttpContextBase httpContext, bool reportOnly, bool allowNull)
{
var context = httpContext.GetNWebsecOwinContext() ?? httpContext.GetNWebsecContext();
var configOverride = GetConfigOverrides(context);
if (allowNull)
{
return (reportOnly ? configOverride.CspReportOnlyOverride : configOverride.CspOverride) as CspOverrideConfiguration;
}
if (reportOnly)
{
if (configOverride.CspReportOnlyOverride == null)
{
configOverride.CspReportOnlyOverride = new CspOverrideConfiguration();
}
return configOverride.CspReportOnlyOverride as CspOverrideConfiguration;
}
if (configOverride.CspOverride == null)
{
configOverride.CspOverride = new CspOverrideConfiguration();
}
return configOverride.CspOverride as CspOverrideConfiguration;
}