public void Examples() { IAppBuilder appbuilder = null; BuildFunc buildFunc = null; // Add X-Xss-Protection: 1; mode=block buildFunc.XssProtectionHeader(); appbuilder.XssProtectionHeader(); // Add X-Xss-Protection: 0 buildFunc.XssProtectionHeader(disabled: true); appbuilder.XssProtectionHeader(disabled: true); }
/// <summary> /// Adds the "X-Xss-Protection" header to the response. /// </summary> /// <param name="builder">The OWIN builder instance.</param> /// <param name="disabled">true to set the heade value to "0". false (Default) to set the header value to"1; mode=block".</param> /// <returns>The OWIN builder instance.</returns> public static BuildFunc XssProtectionHeader(this BuildFunc builder, bool disabled = false) { return(builder.XssProtectionHeader(disabled ? XssProtectionOption.Disabled : XssProtectionOption.EnabledWithModeBlock)); }