1
0
mirror of https://github.com/astaxie/beego.git synced 2024-09-28 13:41:48 +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 {
output.Header("Content-Encoding", n)
output.Header("Content-Length", strconv.Itoa(buf.Len()))
} else {
output.Header("Content-Length", strconv.Itoa(len(content)))
}