From 42ffcb01b1b2c6fa4c986526e99eb1f8f9c6976a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A1ra=20El-Saig?= Date: Sun, 7 Jan 2024 10:52:41 +0100 Subject: [PATCH] The other way around. --- .../Security/ApplicationBuilderExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lombiq.HelpfulLibraries.AspNetCore/Security/ApplicationBuilderExtensions.cs b/Lombiq.HelpfulLibraries.AspNetCore/Security/ApplicationBuilderExtensions.cs index aa802fca..265d20b4 100644 --- a/Lombiq.HelpfulLibraries.AspNetCore/Security/ApplicationBuilderExtensions.cs +++ b/Lombiq.HelpfulLibraries.AspNetCore/Security/ApplicationBuilderExtensions.cs @@ -59,7 +59,7 @@ public static IApplicationBuilder UseContentSecurityPolicyHeader( context.Response.OnStarting(async () => { // No need to do content security policy on non-HTML responses. - if (context.Response.ContentType?.ContainsOrdinalIgnoreCase("text/html") == true) return; + if (context.Response.ContentType?.ContainsOrdinalIgnoreCase("text/html") != true) return; // The thought behind this provider model is that if you need something else than the default, you should // add a provider that only applies the additional directive on screens where it's actually needed. This way