diff --git a/backend/allowance_planner.db3.backup.3 b/backend/allowance_planner.db3.backup.3 index b7a3e07..380cafd 100644 Binary files a/backend/allowance_planner.db3.backup.3 and b/backend/allowance_planner.db3.backup.3 differ diff --git a/backend/web.go b/backend/web.go index e9c5687..d8188e1 100644 --- a/backend/web.go +++ b/backend/web.go @@ -28,8 +28,13 @@ func loadWebEndpoints(router *gin.Engine) { } func redirectToPage(c *gin.Context, page string) { + redirectToPageStatus(c, page, http.StatusSeeOther) +} + +func redirectToPageStatus(c *gin.Context, page string, status int) { scheme := c.Request.URL.Scheme - c.Redirect(http.StatusSeeOther, scheme+domain+page) + target := scheme + domain + page + c.Redirect(status, target) } func renderLogin(c *gin.Context) { @@ -75,7 +80,7 @@ func renderCreateTask(c *gin.Context) { return } - c.Redirect(http.StatusFound, "/") + redirectToPageStatus(c, "/", http.StatusFound) } func renderCompleteTask(c *gin.Context) { @@ -92,7 +97,7 @@ func renderCompleteTask(c *gin.Context) { return } - c.Redirect(http.StatusFound, "/") + redirectToPageStatus(c, "/", http.StatusFound) } func renderCreateAllowance(c *gin.Context) { @@ -129,7 +134,7 @@ func renderCreateAllowance(c *gin.Context) { return } - c.Redirect(http.StatusFound, "/") + redirectToPageStatus(c, "/", http.StatusFound) } func renderCompleteAllowance(c *gin.Context) { @@ -151,7 +156,7 @@ func renderCompleteAllowance(c *gin.Context) { return } - c.Redirect(http.StatusFound, "/") + redirectToPageStatus(c, "/", http.StatusFound) } func getCurrentUser(c *gin.Context) *int { @@ -180,7 +185,7 @@ func getCurrentUser(c *gin.Context) *int { func unsetUserCookie(c *gin.Context) { c.SetCookie("user", "", -1, "/", "localhost", false, true) - c.Redirect(http.StatusFound, "/") + redirectToPageStatus(c, "/", http.StatusFound) } func renderNoUser(c *gin.Context) { diff --git a/backend/web.gohtml b/backend/web.gohtml index 1ed49ee..cd23150 100644 --- a/backend/web.gohtml +++ b/backend/web.gohtml @@ -3,9 +3,11 @@