diff options
| author | gammelalf <gammelalf@hopfen.space> | 2023-01-24 12:36:44 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2023-02-24 12:47:40 +0100 |
| commit | 5afc01e3de9b17df98c681acaa92779c44ed9738 (patch) | |
| tree | e49d80bf06fe59341bd47fb0396f84a239b008d6 | |
| parent | 49a80e503325e2736d91c0c2bc6935572886d119 (diff) | |
| download | WRMS-5afc01e3de9b17df98c681acaa92779c44ed9738.tar.gz WRMS-5afc01e3de9b17df98c681acaa92779c44ed9738.zip | |
Bodged missing cookie
| -rw-r--r-- | main.go | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -18,7 +18,11 @@ import ( var wrms *Wrms func landingPage(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, "/static/index.html", 301) + if _, err := r.Cookie("UUID"); err != nil { + http.SetCookie(w, &http.Cookie{Name: "UUID", Value: uuid.NewString(), Path: "/",}) + } + + http.Redirect(w, r, "/static/index.html", http.StatusSeeOther) } func searchHandler(w http.ResponseWriter, r *http.Request) { |
