Skip to content

Commit

Permalink
Fix registering "/" endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Minoxs committed Apr 24, 2022
1 parent 3121e58 commit 64e2795
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package simplerouter
// Makes sure the patterns are in the right format
// That is, always a leading slash, and no trailing slashes
func cleanPattern(pattern string) string {
if len(pattern) == 0 {
if len(pattern) == 0 || pattern == "/" {
return "/"
}

Expand Down

0 comments on commit 64e2795

Please sign in to comment.