Browse Source

fix(wrapper): 去掉包装后的abp默认错误标头

pull/406/head
cKey 4 years ago
parent
commit
e945cf3dc5
  1. 4
      aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs
  2. 5
      aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs

4
aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs

@ -23,9 +23,9 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling
{
protected override bool ShouldHandleException(PageHandlerExecutingContext context)
{
if (!context.ActionDescriptor.CanWarpRsult())
if (context.ActionDescriptor.CanWarpRsult())
{
return false;
return true;
}
return base.ShouldHandleException(context);
}

5
aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs

@ -26,9 +26,9 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling
{
var wrapResultChecker = context.GetRequiredService<IWrapResultChecker>();
if (!wrapResultChecker.WrapOnException(context))
if (wrapResultChecker.WrapOnException(context))
{
return false;
return true;
}
return base.ShouldHandleException(context);
}
@ -55,7 +55,6 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling
await context.GetRequiredService<IExceptionNotifier>().NotifyAsync(new ExceptionNotificationContext(context.Exception));
context.HttpContext.Response.Headers.Add(AbpHttpConsts.AbpErrorFormat, "true");
context.HttpContext.Response.Headers.Add(AbpHttpWrapConsts.AbpWrapResult, "true");
context.HttpContext.Response.StatusCode = (int)wrapResultOptions.HttpStatusCode;

Loading…
Cancel
Save