1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-16 13:00:55 +00:00

Merge pull request #2359 from kbynd/patch-1

content-length not set in case EnableGZIP=true
This commit is contained in:
astaxie 2017-01-02 11:49:11 +08:00 committed by GitHub
commit 195c9b24eb

View File

@ -67,6 +67,7 @@ func (output *BeegoOutput) Body(content []byte) error {
} }
if b, n, _ := WriteBody(encoding, buf, content); b { if b, n, _ := WriteBody(encoding, buf, content); b {
output.Header("Content-Encoding", n) output.Header("Content-Encoding", n)
output.Header("Content-Length", strconv.Itoa(buf.Len()))
} else { } else {
output.Header("Content-Length", strconv.Itoa(len(content))) output.Header("Content-Length", strconv.Itoa(len(content)))
} }