Fixing sign in / out redirect

This commit is contained in:
metacryst
2025-10-12 18:46:07 -05:00
parent 8a6f3da116
commit e0f9866ab4
3 changed files with 26 additions and 15 deletions

View File

@@ -84,9 +84,13 @@ func servePublicFile(w http.ResponseWriter, r *http.Request) {
path := r.URL.Path
if path == "/" {
w.Header().Set("Cache-Control", "no-store")
// Required for sign in / sign out redirect to work properly
w.Header().Set("Cache-Control", "no-store, no-cache, must-revalidate, proxy-revalidate")
w.Header().Set("Pragma", "no-cache")
w.Header().Set("Expires", "0")
w.Header().Set("Surrogate-Control", "no-store")
path = "/index.html"
} else if !strings.Contains(path, ".") {
path = filepath.Join("/pages", path) + ".html"
@@ -114,6 +118,13 @@ func serveSiteFiles(w http.ResponseWriter, r *http.Request) {
path := r.URL.Path
if path == "/" {
// Required for sign in / sign out redirect to work properly
w.Header().Set("Cache-Control", "no-store, no-cache, must-revalidate, proxy-revalidate")
w.Header().Set("Pragma", "no-cache")
w.Header().Set("Expires", "0")
w.Header().Set("Surrogate-Control", "no-store")
path = "/index.html"
} else if !strings.Contains(path, ".") {
path = filepath.Join("/pages", path) + ".html"