Skip to content

Commit

Permalink
Fix: Replace TrimLeft with TrimPrefix for webroot path handling (#441)
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Feb 13, 2025
1 parent d0458e2 commit a3bd624
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func embedController(w http.ResponseWriter, r *http.Request) {
p = p + "index.html"
}

p = strings.TrimLeft(p, config.Webroot) // server webroot config
p = path.Join("ui", p) // add go:embed path to path prefix
p = strings.TrimPrefix(p, config.Webroot) // server webroot config
p = path.Join("ui", p) // add go:embed path to path prefix

b, err := distFS.ReadFile(p)
if err != nil {
Expand Down

0 comments on commit a3bd624

Please sign in to comment.