fix no default index page
This commit is contained in:
parent
e9fbfd0277
commit
75c3a98f33
@ -112,6 +112,9 @@ func (this *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set(`Access-Control-Allow-Origin`, `*`)
|
||||
w.WriteHeader(200)
|
||||
|
||||
} else if r.Method == "GET" && r.URL.Path == `/` {
|
||||
http.Redirect(w, r, `/index.html`, http.StatusFound)
|
||||
|
||||
} else if static, err := Asset(r.URL.Path[1:]); err == nil && r.Method == "GET" {
|
||||
http.ServeContent(w, r, r.URL.Path[1:], this.startTime, bytes.NewReader(static))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user