From 6a5609a8ec220705a34f9c88d2463bda8956c5cf Mon Sep 17 00:00:00 2001 From: sparkie79 Date: Sun, 29 Dec 2024 18:36:03 +0100 Subject: [PATCH] Set ContentType in Facebook script Middleware Set ContentType to "text/javascript" when returning facebook scripts Fixes #17286 --- .../OrchardCore.Facebook/ScriptsMiddleware.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OrchardCore.Modules/OrchardCore.Facebook/ScriptsMiddleware.cs b/src/OrchardCore.Modules/OrchardCore.Facebook/ScriptsMiddleware.cs index d0ff92f0b48..e038f63e7b7 100644 --- a/src/OrchardCore.Modules/OrchardCore.Facebook/ScriptsMiddleware.cs +++ b/src/OrchardCore.Modules/OrchardCore.Facebook/ScriptsMiddleware.cs @@ -52,6 +52,7 @@ public async Task Invoke(HttpContext httpContext) if (script != null) { var bytes = Encoding.UTF8.GetBytes(script); + httpContext.Response.ContentType = "text/javascript"; await httpContext.Response.Body.WriteAsync(Encoding.UTF8.GetBytes(script).AsMemory(0, bytes.Length), httpContext.RequestAborted); return;