From 0df0bb8052e55d8df5c8255954da496320714ce0 Mon Sep 17 00:00:00 2001 From: hyhkjiy <2632790902@qq.com> Date: Wed, 14 Mar 2018 19:46:55 +0800 Subject: [PATCH] Update gzip_response_writer.go The Context.SendFile function Send file size more than 65536 byte with bug. Former-commit-id: 5ad4c80eb20a7e6663fc460ec68e238dd45a918a --- context/gzip_response_writer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/context/gzip_response_writer.go b/context/gzip_response_writer.go index de92053e..c4f79586 100644 --- a/context/gzip_response_writer.go +++ b/context/gzip_response_writer.go @@ -108,7 +108,7 @@ func (w *GzipResponseWriter) EndResponse() { func (w *GzipResponseWriter) Write(contents []byte) (int, error) { // save the contents to serve them (only gzip data here) w.chunks = append(w.chunks, contents...) - return len(w.chunks), nil + return len(contents), nil } // Writef formats according to a format specifier and writes to the response.