Always use lowercase username, as it is used for referential integrity. Fixes #352

This commit is contained in:
Deluan
2020-06-14 20:20:10 -04:00
parent 2d1d992e17
commit a6af46dbad
3 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ package request
import (
"context"
"strings"
"github.com/deluan/navidrome/model"
)
@@ -22,7 +23,7 @@ func WithUser(ctx context.Context, u model.User) context.Context {
}
func WithUsername(ctx context.Context, username string) context.Context {
return context.WithValue(ctx, Username, username)
return context.WithValue(ctx, Username, strings.ToLower(username))
}
func WithClient(ctx context.Context, client string) context.Context {