~evanj/cms

7829d91c45124b8c101ad74a8187406d8bf7aeb4 — Evan J 2 months ago 6c927cd
Fix(cms.go): Flush header values when wrapping ResponseWriter.
1 files changed, 3 insertions(+), 0 deletions(-)

M cms.go
M cms.go => cms.go +3 -0
@@ 51,6 51,9 @@ func (rw *wrappedResponseWriter) Write(bytes []byte) (int, error) { return rw.b.
func (rw *wrappedResponseWriter) WriteHeader(statusCode int)      { rw.sc = statusCode }

func (rw *wrappedResponseWriter) Flush() error {
	for key := range rw.h {
		rw.w.Header().Add(key, rw.h.Get(key))
	}
	rw.w.WriteHeader(rw.sc)
	_, err := rw.w.Write(rw.b.Bytes())
	return err