X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=parsers.c;h=14aa99ea8cbbb3a603e8501a706fd281fab97fed;hb=HEAD;hp=3197c4ff6644c77e7d9c89a78a9b13e29f06da01;hpb=f018685d622080d08641471be338e5e2b698d8df;p=privoxy.git diff --git a/parsers.c b/parsers.c index 3197c4ff..1cb46dfe 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)) { @@ -4617,7 +4628,10 @@ static jb_err parse_time_header(const char *header, time_t *result) * through sed() which requires a header name followed by * a colon. */ - assert(header_time != NULL); + if (header_time == NULL) + { + return JB_ERR_PARSE; + } header_time++; if (*header_time == ' ')