Refactor code for reading the body of a request

This commit is contained in:
Slendy 2023-04-06 22:23:49 -05:00
parent 2372dfbb9e
commit 4150e44f80
No known key found for this signature in database
GPG key ID: 7288D68361B91428
6 changed files with 45 additions and 69 deletions

View file

@ -30,9 +30,7 @@ public class LoginController : ControllerBase
[HttpPost]
public async Task<IActionResult> Login()
{
MemoryStream ms = new();
await this.Request.Body.CopyToAsync(ms);
byte[] loginData = ms.ToArray();
byte[] loginData = await this.Request.BodyReader.ReadAllAsync();
NPTicket? npTicket;
try