Api: RegisterForDispose DisposableHttpContext
This commit is contained in:
parent
c34b1a0d95
commit
1fd62e757c
@ -6,6 +6,7 @@ using ASC.Api.Core.Middleware;
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Common.Web;
|
||||
using ASC.Core;
|
||||
using ASC.Data.Reassigns;
|
||||
using ASC.Data.Storage.Configuration;
|
||||
@ -120,9 +121,17 @@ namespace ASC.People
|
||||
Thread.CurrentThread.CurrentCulture = user.GetCulture();
|
||||
Thread.CurrentThread.CurrentCulture = user.GetCulture();
|
||||
}
|
||||
|
||||
await next.Invoke();
|
||||
});
|
||||
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
context.Response.RegisterForDispose(new DisposableHttpContext(context));
|
||||
|
||||
await next();
|
||||
});
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
@ -132,7 +141,6 @@ namespace ASC.People
|
||||
app.UseCSP();
|
||||
app.UseCm();
|
||||
app.UseWebItemManager();
|
||||
|
||||
app.UseStaticFiles();
|
||||
}
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
using System.Threading;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Api.Core.Core;
|
||||
using ASC.Api.Core.Middleware;
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Utils;
|
||||
using ASC.Common.Web;
|
||||
using ASC.Core;
|
||||
using ASC.Data.Reassigns;
|
||||
using ASC.Data.Storage.Configuration;
|
||||
@ -115,6 +117,13 @@ namespace ASC.Web.Api
|
||||
await next.Invoke();
|
||||
});
|
||||
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
context.Response.RegisterForDispose(new DisposableHttpContext(context));
|
||||
|
||||
await next();
|
||||
});
|
||||
|
||||
app.UseEndpoints(endpoints =>
|
||||
{
|
||||
endpoints.MapControllers();
|
||||
|
Loading…
Reference in New Issue
Block a user