From b35747bf3111e24ef062bd9879f2ca461debf7e9 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Sun, 13 Dec 2020 17:24:16 -0500 Subject: [PATCH] Improve documentation --- gzip.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gzip.go b/gzip.go index ebae3291..4ccc0206 100644 --- a/gzip.go +++ b/gzip.go @@ -20,6 +20,8 @@ type gzipResponseWriter struct { http.ResponseWriter } +// WriteHeader sends an HTTP response header with the provided status code. +// It also deletes the Content-Length header, since the GZIP compression may modify the size of the payload func (w *gzipResponseWriter) WriteHeader(status int) { w.Header().Del("Content-Length") w.ResponseWriter.WriteHeader(status)