1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-08-13 20:04:49 +02:00

Fix: Replace TrimLeft with TrimPrefix for webroot path handling (#441)

This commit is contained in:
Ralph Slooten
2025-02-13 15:55:12 +13:00
parent d0458e2e7a
commit a3bd62482d

View File

@@ -26,8 +26,8 @@ func embedController(w http.ResponseWriter, r *http.Request) {
p = p + "index.html" p = p + "index.html"
} }
p = strings.TrimLeft(p, config.Webroot) // server webroot config p = strings.TrimPrefix(p, config.Webroot) // server webroot config
p = path.Join("ui", p) // add go:embed path to path prefix p = path.Join("ui", p) // add go:embed path to path prefix
b, err := distFS.ReadFile(p) b, err := distFS.ReadFile(p)
if err != nil { if err != nil {