Replace gg.If with cmp.Or
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user