Skip to content

Commit

Permalink
banned word fix
Browse files Browse the repository at this point in the history
  • Loading branch information
th0rn0 committed Sep 27, 2024
1 parent b42ab62 commit fd64e07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/templates/banned-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ orgasm
beats by talent
weeb
cock
dick
dick
pepper coyote
4 changes: 2 additions & 2 deletions api/tracks.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ func handleTrack(c *gin.Context) {

// Check for Banned Filter
for _, artist := range track.Artists {
if containsBannedWord(artist.Name) {
if containsBannedWord(strings.ToLower(artist.Name)) {
c.JSON(http.StatusBadRequest, "Fuck off")
return
}
}

if containsBannedWord(track.Name) || isBannedTrack(track.URI) || track.Duration > 600000 {
if containsBannedWord(strings.ToLower(track.Name)) || isBannedTrack(track.URI) || track.Duration > 600000 {
c.JSON(http.StatusBadRequest, "Fuck off")
return
}
Expand Down

0 comments on commit fd64e07

Please sign in to comment.