Replace gg.If with cmp.Or

This commit is contained in:
Deluan
2024-06-05 22:48:00 -04:00
parent 11bef060a3
commit b4ef1b1e38
5 changed files with 6 additions and 47 deletions
+2 -2
View File
@@ -1,6 +1,7 @@
package subsonic
import (
"cmp"
"crypto/md5"
"encoding/hex"
"errors"
@@ -20,7 +21,6 @@ import (
"github.com/navidrome/navidrome/model/request"
"github.com/navidrome/navidrome/server"
"github.com/navidrome/navidrome/server/subsonic/responses"
. "github.com/navidrome/navidrome/utils/gg"
"github.com/navidrome/navidrome/utils/req"
)
@@ -183,7 +183,7 @@ func getPlayer(players core.Players) func(next http.Handler) http.Handler {
MaxAge: consts.CookieExpiry,
HttpOnly: true,
SameSite: http.SameSiteStrictMode,
Path: If(conf.Server.BasePath, "/"),
Path: cmp.Or(conf.Server.BasePath, "/"),
}
http.SetCookie(w, cookie)
}