From e54b72c9b01bb953b2e537f778313284b48d759c Mon Sep 17 00:00:00 2001 From: 杨宇千 Date: Thu, 17 Oct 2019 15:13:41 +0800 Subject: ... --- Timeline/Controllers/UserAvatarController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Timeline/Controllers/UserAvatarController.cs') diff --git a/Timeline/Controllers/UserAvatarController.cs b/Timeline/Controllers/UserAvatarController.cs index e7e12d0b..e77076ca 100644 --- a/Timeline/Controllers/UserAvatarController.cs +++ b/Timeline/Controllers/UserAvatarController.cs @@ -122,7 +122,8 @@ namespace Timeline.Controllers return BadRequest(new CommonResponse(ErrorCodes.Put_Content_UnmatchedLength_Less, $"Content length in header is {contentLength} but actual length is {bytesRead}.")); - if (Request.Body.ReadByte() != -1) + var extraByte = new byte[1]; + if (await Request.Body.ReadAsync(extraByte) != 0) return BadRequest(new CommonResponse(ErrorCodes.Put_Content_UnmatchedLength_Bigger, $"Content length in header is {contentLength} but actual length is bigger than that.")); -- cgit v1.2.3