X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=parsers.c;h=dcb12305b753bd01509427909f5a67b971fc4713;hb=ddcf61e945b17ebe8a36c184abaf317a52f6da43;hp=3197c4ff6644c77e7d9c89a78a9b13e29f06da01;hpb=f018685d622080d08641471be338e5e2b698d8df;p=privoxy.git diff --git a/parsers.c b/parsers.c index 3197c4ff..dcb12305 100644 --- a/parsers.c +++ b/parsers.c @@ -1301,6 +1301,17 @@ jb_err sed(struct client_state *csp, int filter_server_headers) v++; } + if (filter_server_headers && + (csp->flags & CSP_FLAG_SERVER_CONTENT_LENGTH_SET) && + (csp->flags & CSP_FLAG_CHUNKED)) + { + /* RFC 2616 4.4 3 */ + log_error(LOG_LEVEL_HEADER, "Ignoring the Content-Length header " + "sent by the server as the response is chunk-encoded."); + csp->flags &= ~CSP_FLAG_CONTENT_LENGTH_SET; + csp->expected_content_length = 0; + } + /* place additional headers on the csp->headers list */ while ((err == JB_ERR_OK) && (*f)) {