skttl
05/30/2024, 12:19 PMMatt Wise
05/30/2024, 12:26 PMbuilder.Services.Configure<UmbracoPipelineOptions>(options =>
{
#if NET8_0_OR_GREATER
options.AddFilter(new UmbracoPipelineFilter(
CspConstants.PackageAlias,
postPipeline: applicationBuilder =>
{
applicationBuilder.UseMiddleware<CspMiddleware>();
}));
});
#else
options.AddFilter(new UmbracoPipelineFilter(
CspConstants.PackageAlias,
_ => { },
applicationBuilder =>
{
applicationBuilder.UseMiddleware<CspMiddleware>();
},
_ => { }));
});
#endif
Matt Wise
05/30/2024, 12:26 PMD_Inventor
05/30/2024, 12:43 PMskttl
05/30/2024, 12:46 PMskttl
05/30/2024, 12:46 PMNik
05/31/2024, 8:25 AMcontext.Response
event bits I believe inside the InvokeAsync method.. something a bit like this:
cs
context.Response.OnStarting(async () =>
{
//maniuplate response here - but watch out for things like content length headers ending up incorrect
}
(https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/request-response?view=aspnetcore-8.0#startasync might help with that.)Rataplan
05/31/2024, 8:50 AMMike Chambers
05/31/2024, 9:21 AMSystem.InvalidOperationException: The response headers cannot be modified because the response has already started.
have already been sent!A hub and casual space for you to interact with fellow community members and learn more about Umbraco!
Powered by