mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Make NewCookieOptions exported in cookies.go (#56476)
This commit is contained in:
parent
5361efc225
commit
1de0f4453e
@ -16,7 +16,7 @@ type CookieOptions struct {
|
|||||||
SameSiteMode http.SameSite
|
SameSiteMode http.SameSite
|
||||||
}
|
}
|
||||||
|
|
||||||
func newCookieOptions() CookieOptions {
|
func NewCookieOptions() CookieOptions {
|
||||||
path := "/"
|
path := "/"
|
||||||
if len(setting.AppSubUrl) > 0 {
|
if len(setting.AppSubUrl) > 0 {
|
||||||
path = setting.AppSubUrl
|
path = setting.AppSubUrl
|
||||||
@ -37,7 +37,7 @@ func DeleteCookie(w http.ResponseWriter, name string, getCookieOptions getCookie
|
|||||||
|
|
||||||
func WriteCookie(w http.ResponseWriter, name string, value string, maxAge int, getCookieOptions getCookieOptionsFunc) {
|
func WriteCookie(w http.ResponseWriter, name string, value string, maxAge int, getCookieOptions getCookieOptionsFunc) {
|
||||||
if getCookieOptions == nil {
|
if getCookieOptions == nil {
|
||||||
getCookieOptions = newCookieOptions
|
getCookieOptions = NewCookieOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
options := getCookieOptions()
|
options := getCookieOptions()
|
||||||
|
Loading…
Reference in New Issue
Block a user