diff options
author | 杨宇千 <crupest@outlook.com> | 2019-10-17 15:13:41 +0800 |
---|---|---|
committer | 杨宇千 <crupest@outlook.com> | 2019-10-17 15:13:41 +0800 |
commit | ea1e708f2fc179c5fc0bf1eda83482ad0ce7ea33 (patch) | |
tree | 7f19e86f51613b46d3ab3aff02b8abd9f71bb0b0 /Timeline/Controllers | |
parent | 7c021c429ea77dffdd877c3e2a0bcf6e881a7285 (diff) | |
download | timeline-ea1e708f2fc179c5fc0bf1eda83482ad0ce7ea33.tar.gz timeline-ea1e708f2fc179c5fc0bf1eda83482ad0ce7ea33.tar.bz2 timeline-ea1e708f2fc179c5fc0bf1eda83482ad0ce7ea33.zip |
...
Diffstat (limited to 'Timeline/Controllers')
-rw-r--r-- | Timeline/Controllers/UserAvatarController.cs | 3 |
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."));
|