final ClientResponse responseContext = new ClientResponse(
Response.Status.OK, requestContext);
String headerValue = requestContext.getHeaderString(ACCEPT_ENCODING);
if (headerValue != null) {
responseContext.header(ACCEPT_ENCODING, headerValue);
}
headerValue = requestContext.getHeaderString(CONTENT_ENCODING);
if (headerValue != null) {
responseContext.header(CONTENT_ENCODING, headerValue);
}