From fd64e072117c10a9846415950769875811dbb008 Mon Sep 17 00:00:00 2001 From: Th0rn0 Date: Fri, 27 Sep 2024 17:20:28 +0100 Subject: [PATCH] banned word fix --- api/templates/banned-words.txt | 3 ++- api/tracks.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/templates/banned-words.txt b/api/templates/banned-words.txt index 065154b..83cc485 100644 --- a/api/templates/banned-words.txt +++ b/api/templates/banned-words.txt @@ -5,4 +5,5 @@ orgasm beats by talent weeb cock -dick \ No newline at end of file +dick +pepper coyote \ No newline at end of file diff --git a/api/tracks.go b/api/tracks.go index cdd487e..ca0abc3 100644 --- a/api/tracks.go +++ b/api/tracks.go @@ -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 }