Using c.Data() to write 404 error

This commit is contained in:
Manu Mtz-Almeida 2014-07-05 19:23:40 +02:00
parent ee1406bc4f
commit f19cca070e
1 changed files with 1 additions and 1 deletions

2
gin.go
View File

@ -143,7 +143,7 @@ func (engine *Engine) handle404(w http.ResponseWriter, req *http.Request) {
c.Writer.setStatus(404)
c.Next()
if !c.Writer.Written() {
c.String(404, "404 page not found")
c.Data(404, MIMEPlain, []byte("404 page not found"))
}
engine.reuseContext(c)
}