diff --git a/ProjectLighthouse/Extensions/ControllerExtensions.cs b/ProjectLighthouse/Extensions/ControllerExtensions.cs index 93c82f2e..f7261dff 100644 --- a/ProjectLighthouse/Extensions/ControllerExtensions.cs +++ b/ProjectLighthouse/Extensions/ControllerExtensions.cs @@ -29,7 +29,7 @@ public static partial class ControllerExtensions public static async Task ReadBodyAsync(this ControllerBase controller) { byte[] bodyBytes = await controller.Request.BodyReader.ReadAllAsync(); - if (bodyBytes.Length != controller.Request.ContentLength) + if (controller.Request.ContentLength != null && bodyBytes.Length != controller.Request.ContentLength) { Logger.Warn($"Failed to read entire body, contentType={controller.Request.ContentType}, " + $"contentLen={controller.Request.ContentLength}, readLen={bodyBytes.Length}",