Fix FromHybrid for query data with no body
This commit is contained in:
parent
12a18987b0
commit
a734583b15
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ public class HybridModelBinder(
|
||||||
) : IModelBinder {
|
) : IModelBinder {
|
||||||
public async Task BindModelAsync(ModelBindingContext bindingContext) {
|
public async Task BindModelAsync(ModelBindingContext bindingContext) {
|
||||||
if (bodyBinder != null && bindingContext is
|
if (bodyBinder != null && bindingContext is
|
||||||
{ IsTopLevelObject: true, HttpContext.Request.HasFormContentType: false }) {
|
{ IsTopLevelObject: true, HttpContext.Request: { HasFormContentType: false, ContentLength: > 0 } }) {
|
||||||
bindingContext.BindingSource = BindingSource.Body;
|
bindingContext.BindingSource = BindingSource.Body;
|
||||||
await bodyBinder.BindModelAsync(bindingContext);
|
await bodyBinder.BindModelAsync(bindingContext);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue