From 5bf0526bafe3479f8a71edf6321bc7da3f12a37f Mon Sep 17 00:00:00 2001 From: Mark Janssen Date: Mon, 21 Feb 2022 22:40:08 +0100 Subject: [PATCH] Avoid looking up empty redirect path (#49) Causes errors such as: time="2022-02-21T21:05:55Z" level=error msg="unable to retrieve link: '/', error: record not found" --- redirect.go | 1 + 1 file changed, 1 insertion(+) diff --git a/redirect.go b/redirect.go index 97da04f..598fc40 100644 --- a/redirect.go +++ b/redirect.go @@ -23,6 +23,7 @@ func redirect(a *App) gin.HandlerFunc { if path == "" || path == "/" { c.Redirect(http.StatusFound, a.Config.EmptyRedirect) + return } linkPath := strings.ToLower(path)