Skip to content

Commit

Permalink
Set ContentType in Facebook script Middleware
Browse files Browse the repository at this point in the history
Set ContentType to "text/javascript" when returning facebook scripts

Fixes OrchardCMS#17286
  • Loading branch information
sparkie79 authored Dec 29, 2024
1 parent e51223a commit 6a5609a
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6a5609a

Please sign in to comment.