add warns on static path issues

This commit is contained in:
Umputun
2021-06-01 03:25:35 -05:00
parent 7139c57766
commit 3efcd15747

View File

@@ -235,11 +235,13 @@ func (h *Http) proxyHandler() http.HandlerFunc {
// static match result has webroot:location, i.e. /www:/var/somedir/
ae := strings.Split(match.Destination, ":")
if len(ae) != 2 { // shouldn't happen
log.Printf("[WARN] unexpected static assets destination: %s", match.Destination)
h.Reporter.Report(w, http.StatusInternalServerError)
return
}
fs, err := R.FileServer(ae[0], ae[1])
if err != nil {
log.Printf("[WARN] file server error, %v", err)
h.Reporter.Report(w, http.StatusInternalServerError)
return
}