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 | e54b72c9b01bb953b2e537f778313284b48d759c (patch) | |
tree | 7f19e86f51613b46d3ab3aff02b8abd9f71bb0b0 /Timeline/Controllers | |
parent | e1fb12bafa9bb5b1d657d223a4131c63cd4c2349 (diff) | |
download | timeline-e54b72c9b01bb953b2e537f778313284b48d759c.tar.gz timeline-e54b72c9b01bb953b2e537f778313284b48d759c.tar.bz2 timeline-e54b72c9b01bb953b2e537f778313284b48d759c.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."));
|