mirror of
https://github.com/eolinker/apinto
synced 2025-11-02 12:54:19 +08:00
body length
This commit is contained in:
@@ -16,7 +16,7 @@ type Gzip struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (g *Gzip) DoFilter(ctx http_service.IHttpContext, next http_service.IChain) (err error) {
|
func (g *Gzip) DoFilter(ctx http_service.IHttpContext, next http_service.IChain) (err error) {
|
||||||
head := ctx.Request().Header().GetHeader("Accept-encoding")
|
head := ctx.Request().Header().GetHeader("Accept-Encoding")
|
||||||
if next != nil {
|
if next != nil {
|
||||||
err = next.DoChain(ctx)
|
err = next.DoChain(ctx)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ func NewResponse(ctx *fasthttp.RequestCtx) *Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (r *Response) BodyLen() int {
|
func (r *Response) BodyLen() int {
|
||||||
return r.header.Len()
|
return r.header.ContentLength()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Response) GetBody() []byte {
|
func (r *Response) GetBody() []byte {
|
||||||
|
|||||||
Reference in New Issue
Block a user