Browse Source

Using c.Data() to write 404 error

Manu Mtz-Almeida 11 years ago
parent
commit
f19cca070e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      gin.go

+ 1 - 1
gin.go

@@ -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)
 }