Skip to content

Commit

Permalink
throw http 400 if both track and encodedTrack/identifier is set
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Dec 2, 2023
1 parent 0d6f17a commit 7e836ad
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ class PlayerRestHandler(
): ResponseEntity<Player> {
val context = socketContext(socketServer, sessionId)

if (playerUpdate.track.isPresent() && (playerUpdate.encodedTrack is Omissible.Present || playerUpdate.identifier is Omissible.Present)) {
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "Cannot specify both track and encodedTrack/identifier")
}

val track = if (playerUpdate.track.isPresent()) {
playerUpdate.track
} else {
Expand Down

0 comments on commit 7e836ad

Please sign in to comment.