From 20ea7818237f15d76c4eecac819550bcc8eecb29 Mon Sep 17 00:00:00 2001 From: Erik Dubbelboer Date: Tue, 28 May 2019 10:46:25 +0200 Subject: [PATCH] Add warning to RequestCtx.Error Fixes #578 --- server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server.go b/server.go index 93c7b0e..98a5be8 100644 --- a/server.go +++ b/server.go @@ -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)