Skip to content

Commit

Permalink
check if user id is 0 when connecting to lavalink
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jul 6, 2023
1 parent c1f9f9a commit e2d1579
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ constructor(private val serverConfig: ServerConfig, private val socketServer: So
return false
}

if (request.headers.getFirst("User-Id") == null) {
val userId = request.headers.getFirst("User-Id")
if (userId.isNullOrEmpty() || userId.toLongOrNull() == 0L) {
log.error("Missing User-Id header from ${request.remoteAddress}")
response.setStatusCode(HttpStatus.BAD_REQUEST)
return false
Expand Down

0 comments on commit e2d1579

Please sign in to comment.