File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -79,13 +79,14 @@ func init() {
7979 // like the Version string dynamically from the Go build.
8080 indexTmpl = template .Must (template .ParseFiles ("./templates/index.html" ))
8181 r .GET ("/" , func (c * gin.Context ) {
82- c .Header ("Content-Type" , "text/html; charset=utf-8" )
8382 data := struct { Version string }{Version : Version }
84- if err := indexTmpl .Execute (c .Writer , data ); err != nil {
83+ var buf bytes.Buffer
84+ if err := indexTmpl .Execute (& buf , data ); err != nil {
8585 log .Printf ("failed to render index template: %v" , err )
8686 c .String (http .StatusInternalServerError , "Internal Server Error" )
8787 return
8888 }
89+ c .Data (http .StatusOK , "text/html; charset=utf-8" , buf .Bytes ())
8990 })
9091 r .GET ("/favicon.ico" , func (c * gin.Context ) {
9192 c .File ("./static/favicon.ico" )
You can’t perform that action at this time.
0 commit comments