Skip to content

Commit

Permalink
ReportingEndpoints: Dont send BadRequest on unknown level when redire…
Browse files Browse the repository at this point in the history
…cting grief reports to photos
  • Loading branch information
Beyley committed Nov 16, 2023
1 parent 1816c99 commit 66e69ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Refresh.GameServer/Endpoints/Game/ReportingEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ public Response UploadReport(RequestContext context, GameDatabaseContext databas
return BadRequest;
}

//If the level is specified but its invalid, return BadRequest
if (body.LevelId != 0 && level == null)
return BadRequest;

if (user.RedirectGriefReportsToPhotos)
{
List<SerializedPhotoSubject> subjects = new();
Expand Down Expand Up @@ -87,6 +83,10 @@ public Response UploadReport(RequestContext context, GameDatabaseContext databas
return OK;
}

//If the level is specified but its invalid, return BadRequest
if (body.LevelId != 0 && level == null)
return BadRequest;

//Basic validation
if (body.Players is { Length: > 4 } || body.ScreenElements is { Player.Length: > 4 })
return BadRequest;
Expand Down

0 comments on commit 66e69ee

Please sign in to comment.