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,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 {
|
||||
|
Reference in New Issue
Block a user