fix issue with favicon
This commit is contained in:
parent
368cae2676
commit
f7e5a01008
|
@ -7,10 +7,13 @@ import (
|
|||
)
|
||||
|
||||
func ServeFavicon(ctx *fasthttp.RequestCtx) {
|
||||
f, _ := Favicon.ReadFile("favicon.ico")
|
||||
f, e := Favicon.ReadFile("./conf/favicon.ico")
|
||||
if e != nil {
|
||||
ctx.Response.SetStatusCode(fasthttp.StatusInternalServerError)
|
||||
}
|
||||
b := bytes.NewBuffer(f)
|
||||
ctx.Response.Header.Set("Content-Type", "image/x-icon")
|
||||
_, e := io.Copy(ctx.Response.BodyWriter(), b)
|
||||
_, e = io.Copy(ctx.Response.BodyWriter(), b)
|
||||
if e != nil {
|
||||
ctx.Response.SetStatusCode(fasthttp.StatusInternalServerError)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue