public void Setup() { var mockedContext = new Mock<HttpContextBase>(); IDictionary<String, Object> nwebsecContentItems = new Dictionary<string, object>(); mockedContext.Setup(x => x.Items["nwebsecheaderoverride"]).Returns(nwebsecContentItems); _mockContext = mockedContext.Object; _headerConfigurationOverrideHelper = new HeaderConfigurationOverrideHelper(); }
/// <summary> /// Initializes a new instance of the <see cref="XFrameOptionsAttribute"/> class /// </summary> public XFrameOptionsAttribute() { _config = new XFrameOptionsConfiguration { Policy = XfoPolicy.Deny }; _configurationOverrideHelper = new HeaderConfigurationOverrideHelper(); _headerOverrideHelper = new HeaderOverrideHelper(); }
/// <summary> /// Initializes a new instance of the <see cref="XRobotsTagAttribute"/> class /// </summary> public XRobotsTagAttribute() { _config = new XRobotsTagConfiguration { Enabled = true }; _headerConfigurationOverrideHelper = new HeaderConfigurationOverrideHelper(); _headerOverrideHelper = new HeaderOverrideHelper(); }
/// <summary> /// Initializes a new instance of the <see cref="XContentTypeOptionsAttribute"/> class /// </summary> public XContentTypeOptionsAttribute() { _config = new SimpleBooleanConfiguration { Enabled = true }; _headerConfigurationOverrideHelper = new HeaderConfigurationOverrideHelper(); _headerOverrideHelper = new HeaderOverrideHelper(); }
/// <summary> /// Initializes a new instance of the <see cref="XXssProtectionAttribute"/> class /// </summary> public XXssProtectionAttribute() { _config = new XXssProtectionConfiguration { Policy = XXssPolicy.FilterEnabled, BlockMode = true }; _headerConfigurationOverrideHelper = new HeaderConfigurationOverrideHelper(); _headerOverrideHelper = new HeaderOverrideHelper(); }
/// <summary> /// Initializes a new instance of the <see cref="SetNoCacheHttpHeadersAttribute"/> class /// </summary> public SetNoCacheHttpHeadersAttribute() { _config = new SimpleBooleanConfiguration { Enabled = true }; _configurationOverrideHelper = new HeaderConfigurationOverrideHelper(); _headerOverrideHelper = new HeaderOverrideHelper(); }