From a734583b15971adbceb09445ea007d5d23b5ef48 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Tue, 30 Jan 2024 19:33:32 +0100 Subject: [PATCH] Fix FromHybrid for query data with no body --- .../Core/Extensions/ModelBinderProviderExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Iceshrimp.Backend/Core/Extensions/ModelBinderProviderExtensions.cs b/Iceshrimp.Backend/Core/Extensions/ModelBinderProviderExtensions.cs index bd9eaa7a..c38218ec 100644 --- a/Iceshrimp.Backend/Core/Extensions/ModelBinderProviderExtensions.cs +++ b/Iceshrimp.Backend/Core/Extensions/ModelBinderProviderExtensions.cs @@ -39,7 +39,7 @@ public class HybridModelBinder( ) : IModelBinder { public async Task BindModelAsync(ModelBindingContext bindingContext) { if (bodyBinder != null && bindingContext is - { IsTopLevelObject: true, HttpContext.Request.HasFormContentType: false }) { + { IsTopLevelObject: true, HttpContext.Request: { HasFormContentType: false, ContentLength: > 0 } }) { bindingContext.BindingSource = BindingSource.Body; await bodyBinder.BindModelAsync(bindingContext); }