mirror of
https://github.com/glanceapp/glance.git
synced 2025-06-21 02:18:22 +02:00
Add expiration to theme cookie
This commit is contained in:
parent
bf97829814
commit
40ae263248
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -29,6 +30,7 @@ func (a *application) handleThemeChangeRequest(w http.ResponseWriter, r *http.Re
|
|||||||
Value: themeKey,
|
Value: themeKey,
|
||||||
Path: a.Config.Server.BaseURL + "/",
|
Path: a.Config.Server.BaseURL + "/",
|
||||||
SameSite: http.SameSiteLaxMode,
|
SameSite: http.SameSiteLaxMode,
|
||||||
|
Expires: time.Now().Add(2 * 365 * 24 * time.Hour),
|
||||||
})
|
})
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/css")
|
w.Header().Set("Content-Type", "text/css")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user