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:
@@ -26,7 +26,7 @@ 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)
|
||||||
|
Reference in New Issue
Block a user