Search in sources :

Example 1 with HttpHeader

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());
    }
}
Also used : HttpHeader(org.parosproxy.paros.network.HttpHeader) HttpBody(org.parosproxy.paros.network.HttpBody)

Aggregations

HttpBody (org.parosproxy.paros.network.HttpBody)1 HttpHeader (org.parosproxy.paros.network.HttpHeader)1