summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatt Arnold <matt@thegnuguru.org>2023-06-06 03:30:39 -0400
committerMatt Arnold <matt@thegnuguru.org>2023-06-06 03:30:39 -0400
commit8f2efdab61f30e5674aaf5e3a713719d792a6ee5 (patch)
treee6d87cb09d7c54e197e49cce793365a7c73f978b
parentd3434dc198af745b48ca7ecf02befb8f2c5ee3bf (diff)
Back out yet another change
-rw-r--r--main.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.go b/main.go
index 94023f7..e0719f7 100644
--- a/main.go
+++ b/main.go
@@ -86,7 +86,7 @@ func postFormHandler(w http.ResponseWriter, r *http.Request) {
 		Path:     "/",
 		MaxAge:   3600,
 		HttpOnly: true,
-		Secure:   true,
+		Secure:   false,
 		SameSite: http.SameSiteLaxMode,
 	}
 	http.SetCookie(w, &cookie)
@@ -293,7 +293,7 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
 		Path:     "/",
 		MaxAge:   3600,
 		HttpOnly: true,
-		Secure:   true,
+		Secure:   false,
 		SameSite: http.SameSiteLaxMode,
 	}
 	if r.Method == http.MethodPost {
@@ -432,6 +432,8 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
 		switch {
 		case errors.Is(err, http.ErrNoCookie):
 			cookie = &fakeCookie
+			http.SetCookie(w, cookie)
+			http.Redirect(w, r, r.RequestURI, http.StatusSeeOther)
 
 		default:
 			log.Println(err)