Revert "Fix RIVM-23"

This reverts commit f253448296.
This commit is contained in:
Mihail Slobodyanuk 2022-12-13 17:40:34 +02:00
parent 1c9fd32533
commit 12c3103039

View file

@ -5,17 +5,14 @@ import (
"errors"
"fmt"
"net"
"net/http"
"net/url"
"net/http"
"os"
"sort"
"archive/zip"
"strings"
"time"
"github.com/remyoudompheng/go-misc/zipfs"
"github.com/RiV-chain/RiV-mesh/src/config"
"github.com/RiV-chain/RiV-mesh/src/core"
)
@ -271,13 +268,7 @@ func (a *AdminSocket) StartHttpServer(nc *config.NodeConfig) {
}
fmt.Fprintf(w, string(b[:]))
})
fs := http.Dir(nc.WwwRoot)
pak, err := zip.OpenReader(nc.WwwRoot)
if err == nil {
fs = zipfs.NewZipFS(&pak.Reader)
defer pak.Close()
}
http.Handle("/", http.FileServer(fs))
http.Handle("/", http.FileServer(http.Dir(nc.WwwRoot)))
l, e := net.Listen("tcp4", u.Host)
if e != nil {
a.log.Errorln("%s\n", e)