Add warning to RequestCtx.Error

Fixes #578
This commit is contained in:
Erik Dubbelboer
2019-05-28 10:46:25 +02:00
parent 1ee3b845b6
commit 20ea781823
+2
View File
@@ -1008,6 +1008,8 @@ func addrToIP(addr net.Addr) net.IP {
// Error sets response status code to the given value and sets response body
// to the given message.
//
// Warning: this will reset the response headers and body already set!
func (ctx *RequestCtx) Error(msg string, statusCode int) {
ctx.Response.Reset()
ctx.SetStatusCode(statusCode)