use of org.parosproxy.paros.network.HttpHeader in project zaproxy by zaproxy.
the class ProxyThread method decodeResponseIfNeeded.
static void decodeResponseIfNeeded(HttpMessage msg) {
HttpBody body = msg.getResponseBody();
if (body.getContentEncodings().isEmpty() || body.hasContentEncodingErrors()) {
return;
}
body.setBody(body.getContent());
body.setContentEncodings(Collections.emptyList());
HttpHeader header = msg.getResponseHeader();
header.setHeader(HttpHeader.CONTENT_ENCODING, null);
if (header.getHeader(HttpHeader.CONTENT_LENGTH) != null) {
header.setContentLength(body.length());
}
}
Aggregations