From aab4925dfcfd67fe77981659286acd50eb2a88de Mon Sep 17 00:00:00 2001 From: Deluan Date: Tue, 18 Oct 2022 11:44:16 -0400 Subject: [PATCH] Restore DefaultLanguage case-sensitiveness by reverting commit bfeb8ef6b3e5756d72b230abdbb96f8a31b2e2f. Language code should be case-sensitive. Fix #1946. Supersedes #1947. --- server/serve_index.go | 2 +- server/serve_index_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/serve_index.go b/server/serve_index.go index 182456330..6ad363a36 100644 --- a/server/serve_index.go +++ b/server/serve_index.go @@ -38,7 +38,7 @@ func serveIndex(ds model.DataStore, fs fs.FS) http.HandlerFunc { "enableFavourites": conf.Server.EnableFavourites, "enableStarRating": conf.Server.EnableStarRating, "defaultTheme": conf.Server.DefaultTheme, - "defaultLanguage": strings.ToLower(conf.Server.DefaultLanguage), + "defaultLanguage": conf.Server.DefaultLanguage, "enableCoverAnimation": conf.Server.EnableCoverAnimation, "gaTrackingId": conf.Server.GATrackingID, "losslessFormats": strings.ToUpper(strings.Join(consts.LosslessFormats, ",")), diff --git a/server/serve_index_test.go b/server/serve_index_test.go index d602a7fe2..223309de4 100644 --- a/server/serve_index_test.go +++ b/server/serve_index_test.go @@ -160,7 +160,7 @@ var _ = Describe("serveIndex", func() { }) It("sets the defaultLanguage", func() { - conf.Server.DefaultLanguage = "PT" + conf.Server.DefaultLanguage = "pt" r := httptest.NewRequest("GET", "/index.html", nil) w := httptest.NewRecorder()