DefaultLanguage is now case-insensitive

This commit is contained in:
Deluan 2022-09-28 11:29:55 -04:00
parent ba28e9a109
commit bfeb8ef6b3
2 changed files with 2 additions and 2 deletions

View File

@ -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": conf.Server.DefaultLanguage,
"defaultLanguage": strings.ToLower(conf.Server.DefaultLanguage),
"enableCoverAnimation": conf.Server.EnableCoverAnimation,
"gaTrackingId": conf.Server.GATrackingID,
"losslessFormats": strings.ToUpper(strings.Join(consts.LosslessFormats, ",")),

View File

@ -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()