Skip to content

Commit

Permalink
BUG Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vipwan committed Sep 19, 2023
1 parent 7396081 commit 0c5a63b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Biwen.Settings/Extentions/ApiExtention.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,12 @@ internal class ValidDtoFilter : IEndpointFilter
//EnableBuffering()允许多次调用Stream,并且Position重置为0.
context.HttpContext.Request.EnableBuffering();
//json ->dto
context.HttpContext.Request.Body.Position = 0;//Reset Position= 0.
if ((await context.HttpContext!.Request.ReadFromJsonAsync<ExpandoObject>()) is not IDictionary<string, object> dto)
{
return Results.BadRequest();
}
context.HttpContext.Request.Body.Position = 0;//Reset Position= 0.

//提供Patch部分更新支持:
var setting = context!.HttpContext!.RequestServices.GetService(type!);
if (setting == null) return Results.NotFound();
Expand Down

0 comments on commit 0c5a63b

Please sign in to comment.