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

change package

This commit is contained in:
JessonChan 2015-11-11 13:47:47 +08:00
parent f457ea0fe9
commit e4c6e5d2e1

View File

@ -28,8 +28,6 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/astaxie/beego/acceptencoder"
) )
// BeegoOutput does work for sending response header. // BeegoOutput does work for sending response header.
@ -57,9 +55,9 @@ func (output *BeegoOutput) Body(content []byte) {
outputWriter := output.Context.ResponseWriter.(io.Writer) outputWriter := output.Context.ResponseWriter.(io.Writer)
var encoding string var encoding string
if output.EnableGzip { if output.EnableGzip {
encoding = acceptencoder.ParseEncoding(output.Context.Input.Request) encoding = ParseEncoding(output.Context.Input.Request)
} }
if b, n, _ := acceptencoder.WriteBody(encoding, outputWriter, content); b { if b, n, _ := WriteBody(encoding, outputWriter, content); b {
output.Header("Content-Encoding", n) output.Header("Content-Encoding", n)
} else { } else {
output.Header("Content-Length", strconv.Itoa(len(content))) output.Header("Content-Length", strconv.Itoa(len(content)))