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 -4
View File
@@ -12,11 +12,9 @@ import (
"time"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/go-chi/cors"
"github.com/navidrome/navidrome/conf"
. "github.com/navidrome/navidrome/utils/gg"
"github.com/go-chi/chi/v5/middleware"
"github.com/navidrome/navidrome/consts"
"github.com/navidrome/navidrome/log"
"github.com/navidrome/navidrome/model/request"
@@ -139,7 +137,7 @@ func clientUniqueIDMiddleware(next http.Handler) http.Handler {
HttpOnly: true,
Secure: true,
SameSite: http.SameSiteStrictMode,
Path: If(conf.Server.BasePath, "/"),
Path: cmp.Or(conf.Server.BasePath, "/"),
}
http.SetCookie(w, c)
} else {