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 (#277)
  • Loading branch information
jvyden authored Nov 16, 2023
2 parents 1816c99 + 66e69ee commit 947b608
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 947b608

Please sign in to comment.