Add error.html

This commit is contained in:
NI
2019-08-27 17:24:37 +08:00
parent d688e9ec42
commit 8fe5d677ec
6 changed files with 123 additions and 19 deletions

View File

@@ -76,14 +76,9 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
case "/socket":
err = serveController(h.socketCtl, w, r, clientLogger)
case "/index.html":
fallthrough
case "/error.html":
err = ErrNotFound
default:
if len(r.URL.Path) > 0 {
err = serveStaticData(
if len(r.URL.Path) > 0 && strings.ToUpper(r.Method) == "GET" {
err = serveStaticCacheData(
r.URL.Path[1:],
staticFileExt(r.URL.Path[1:]),
w,