mirror of https://github.com/gin-gonic/gin.git
Using c.Data() to write 404 error
This commit is contained in:
parent
ee1406bc4f
commit
f19cca070e
2
gin.go
2
gin.go
|
@ -143,7 +143,7 @@ func (engine *Engine) handle404(w http.ResponseWriter, req *http.Request) {
|
||||||
c.Writer.setStatus(404)
|
c.Writer.setStatus(404)
|
||||||
c.Next()
|
c.Next()
|
||||||
if !c.Writer.Written() {
|
if !c.Writer.Written() {
|
||||||
c.String(404, "404 page not found")
|
c.Data(404, MIMEPlain, []byte("404 page not found"))
|
||||||
}
|
}
|
||||||
engine.reuseContext(c)
|
engine.reuseContext(c)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue