Skip to content

Commit

Permalink
Address empty path panic (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDmitry committed Jan 15, 2024
1 parent f080386 commit 7569ccd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ var generatedFiles = map[string]string{
func AssetSkipper(c echo.Context) bool {
path := c.Request().URL.Path
parts := strings.Split(path, "/")
if len(parts) == 0 {
return true
}

collections := []map[string]string{staticFiles, generatedFiles, staticDirs}
for _, col := range collections {
for k := range col {
Expand All @@ -146,6 +150,7 @@ func AssetSkipper(c echo.Context) bool {
}
}
}

for _, part := range parts {
if part == "assets" {
return true
Expand Down

0 comments on commit 7569ccd

Please sign in to comment.