go1.16 and embed

This commit is contained in:
ston1th 2021-02-18 22:36:49 +01:00
commit 8e7bcfc21b
37 changed files with 98 additions and 1134 deletions

View file

@ -97,24 +97,6 @@ func authHandler(h ctxHandler) ctxHandler {
}
}
func staticHandler(ctx *Context) {
var err error
ctx.SetHeader("Content-Type", "text/css; charset=utf-8")
ctx.SetHeader("Expires", time.Now().UTC().Add(max).Format(http.TimeFormat))
switch ctx.Path() {
case core.BootstrapCSS:
err = ctx.Write(ctx.Srv.res["bootstrap.css"])
case core.CustomCSS:
err = ctx.Write(ctx.Srv.res["custom.css"])
case core.Favicon:
ctx.SetHeader("Content-Type", "image/x-icon")
err = ctx.Write(ctx.Srv.res["favicon.ico"])
}
if err != nil {
log.Println("static:", err)
}
}
type registerNotFoundHandler struct {
s *HTTPServer
}