func (t *throttle) Response(ctx filters.FilterContext) { switch t.typ { case backendLatency, backendBandwidth, backendChunks: return } rsp := ctx.Response() rsp.Body = t.goThrottle(rsp.Body, true) }
func (c *compress) Response(ctx filters.FilterContext) { rsp := ctx.Response() if !canEncodeEntity(rsp, c.mime) { return } enc := acceptedEncoding(ctx.Request()) if enc == "" { return } responseHeader(rsp, enc) responseBody(rsp, enc, c.level) }
func (f *headerFilter) Response(ctx filters.FilterContext) { switch f.typ { case setResponseHeader: ctx.Response().Header.Set(f.key, f.value) case appendResponseHeader, depResponseHeader: ctx.Response().Header.Add(f.key, f.value) case dropResponseHeader: ctx.Response().Header.Del(f.key) } }
func (f *headerFilter) Response(ctx filters.FilterContext) { if f.typ == responseHeader { ctx.Response().Header.Add(f.key, f.value) } }
func (corf *preserveOriginalFilter) Response(ctx filters.FilterContext) { preserveHeader(ctx.OriginalResponse().Header, ctx.Response().Header) }
func (f statusFilter) Response(ctx filters.FilterContext) { ctx.Response().StatusCode = int(f) }
func (h *healthCheck) Response(ctx filters.FilterContext) { ctx.Response().StatusCode = http.StatusOK }