From 9cbc5c4214062acfa1505ae6caee8b1a71440bf7 Mon Sep 17 00:00:00 2001 From: Liam Burnand Date: Tue, 16 Jan 2024 22:00:09 +0000 Subject: [PATCH] Fixing redirects to be absolute rather than relative --- controllers/admin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/controllers/admin.go b/controllers/admin.go index bd5861e..eb3b24b 100644 --- a/controllers/admin.go +++ b/controllers/admin.go @@ -399,7 +399,7 @@ func (r *AdminRepo) EditElection(c echo.Context) error { return r.errorHandle(c, err) } - return c.Redirect(http.StatusFound, fmt.Sprintf("admin/election/%d", election.GetId())) + return c.Redirect(http.StatusFound, fmt.Sprintf("/admin/election/%d", election.GetId())) } func (r *AdminRepo) OpenElection(c echo.Context) error { @@ -455,7 +455,7 @@ func (r *AdminRepo) OpenElection(c echo.Context) error { go r.sendEmailThread(voters, election) - return c.Redirect(http.StatusFound, fmt.Sprintf("admin/election/%d", election.GetId())) + return c.Redirect(http.StatusFound, fmt.Sprintf("/admin/election/%d", election.GetId())) } func (r *AdminRepo) sendEmailThread(voters []*storage.Voter, election *storage.Election) { @@ -620,7 +620,7 @@ func (r *AdminRepo) CloseElection(c echo.Context) error { return r.errorHandle(c, err) } - return c.Redirect(http.StatusFound, fmt.Sprintf("admin/election/%d", election.GetId())) + return c.Redirect(http.StatusFound, fmt.Sprintf("/admin/election/%d", election.GetId())) } func (r *AdminRepo) Exclude(c echo.Context) error {