Skip to content

Commit

Permalink
Avoid looking up empty redirect path (#49)
Browse files Browse the repository at this point in the history
Causes errors such as:
time="2022-02-21T21:05:55Z" level=error msg="unable to retrieve link: '/', error: record not found"
  • Loading branch information
praseodym authored Feb 21, 2022
1 parent 1ec2b7d commit 5bf0526
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5bf0526

Please sign in to comment.