aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Controllers/UserAvatarController.cs
diff options
context:
space:
mode:
author杨宇千 <crupest@outlook.com>2019-10-17 15:13:41 +0800
committer杨宇千 <crupest@outlook.com>2019-10-17 15:13:41 +0800
commitea1e708f2fc179c5fc0bf1eda83482ad0ce7ea33 (patch)
tree7f19e86f51613b46d3ab3aff02b8abd9f71bb0b0 /Timeline/Controllers/UserAvatarController.cs
parent7c021c429ea77dffdd877c3e2a0bcf6e881a7285 (diff)
downloadtimeline-ea1e708f2fc179c5fc0bf1eda83482ad0ce7ea33.tar.gz
timeline-ea1e708f2fc179c5fc0bf1eda83482ad0ce7ea33.tar.bz2
timeline-ea1e708f2fc179c5fc0bf1eda83482ad0ce7ea33.zip
...
Diffstat (limited to 'Timeline/Controllers/UserAvatarController.cs')
-rw-r--r--Timeline/Controllers/UserAvatarController.cs3
1 files changed, 2 insertions, 1 deletions
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."));