use of com.netflix.zuul.util.Gzipper in project zuul by Netflix.
the class GZipResponseFilter method processContentChunk.
@Override
public HttpContent processContentChunk(ZuulMessage resp, HttpContent chunk) {
final Gzipper gzipper = (Gzipper) resp.getContext().get(CommonContextKeys.GZIPPER);
gzipper.write(chunk);
if (chunk instanceof LastHttpContent) {
gzipper.finish();
return new DefaultLastHttpContent(gzipper.getByteBuf());
} else {
return new DefaultHttpContent(gzipper.getByteBuf());
}
}
Aggregations