1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00
Former-commit-id: c55f1023f4d93f6712c7fa4d299bcf1098872ecf
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-07-25 09:23:34 +03:00
parent e70ceba051
commit 802348cedd
5 changed files with 68 additions and 1 deletions

View File

@@ -473,6 +473,11 @@ func (h *routerHandler) FireErrorCode(ctx *context.Context) {
// reset if previous content and it's recorder, keep the status code.
w.ClearHeaders()
w.ResetBody()
if cw, ok := w.ResponseWriter.(*context.CompressResponseWriter); ok {
// recorder wraps a compress writer.
cw.Disabled = true
}
} else if w, ok := ctx.ResponseWriter().(*context.CompressResponseWriter); ok {
// reset and disable the gzip in order to be an expected form of http error result
w.Disabled = true