mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-13 00:31:28 +00:00
Properly dispose of StreamReaders
This commit is contained in:
parent
75a5e70635
commit
14fa5e9328
5 changed files with 17 additions and 7 deletions
|
@ -182,8 +182,9 @@ public class UserController : ControllerBase
|
|||
User? user = await this.database.UserFromGameToken(this.GetToken());
|
||||
if (user == null) return this.StatusCode(403, "");
|
||||
|
||||
string pinsString = await new StreamReader(this.Request.Body).ReadToEndAsync();
|
||||
Pins? pinJson = JsonSerializer.Deserialize<Pins>(pinsString);
|
||||
string bodyString = await this.ReadBodyAsync();
|
||||
|
||||
Pins? pinJson = JsonSerializer.Deserialize<Pins>(bodyString);
|
||||
if (pinJson == null) return this.BadRequest();
|
||||
|
||||
// Sometimes the update gets called periodically as pin progress updates via playing,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue