Skip to content

Commit

Permalink
Fix static path
Browse files Browse the repository at this point in the history
  • Loading branch information
ozonophore committed Jan 17, 2024
1 parent 4b6b0ab commit 617e1ea
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions web/internal/middleware/static.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
package middleware

import (
<<<<<<< Updated upstream
"github.com/labstack/echo/v4"
middleware2 "github.com/labstack/echo/v4/middleware"
"io/fs"
"strings"
)

=======
"errors"
"github.com/labstack/echo/v4"
middleware2 "github.com/labstack/echo/v4/middleware"
Expand All @@ -24,7 +16,6 @@ const (
indexPage = "index.html"
)

>>>>>>> Stashed changes
type (
// StaticConfig defines the config for Static middleware.
StaticConfig struct {
Expand Down Expand Up @@ -73,11 +64,7 @@ func Static(filesystem fs.FS, skipedUrls ...string) echo.MiddlewareFunc {
c.Filesystem = filesystem
c.Skipper = func(c echo.Context) bool {
for _, url := range skipedUrls {
<<<<<<< Updated upstream
if strings.Contains(c.Path(), url) {
=======
if strings.Contains(c.Request().URL.Path, url) {
>>>>>>> Stashed changes
return true
}
}
Expand All @@ -103,12 +90,6 @@ func StaticWithConfig(config StaticConfig) echo.MiddlewareFunc {
if config.Skipper(c) {
return next(c)
}
<<<<<<< Updated upstream
return echo.StaticFileHandler(config.Root, config.Filesystem)(c)
}
}
}
=======
return StaticFileHandler(config.Root, config.Filesystem)(c)
}
}
Expand Down Expand Up @@ -169,4 +150,3 @@ func normalizeFolderName(foldeerName string) string {
}
return "/" + foldeerName
}
>>>>>>> Stashed changes

0 comments on commit 617e1ea

Please sign in to comment.