X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=filters.c;h=b490353b2d93c5b1cc40ab80a22cc717372f6cda;hp=278c113e15c20f68df1d994ee99aa21594728de7;hb=3c6244b685f44b3fa0bc48c2c57a4e6bcf97a81f;hpb=bd7800c807e535d21222fa41cb29537cb865b170 diff --git a/filters.c b/filters.c index 278c113e..b490353b 100644 --- a/filters.c +++ b/filters.c @@ -4,7 +4,7 @@ * * Purpose : Declares functions to parse/crunch headers and pages. * - * Copyright : Written by and Copyright (C) 2001-2016 the + * Copyright : Written by and Copyright (C) 2001-2020 the * Privoxy team. https://www.privoxy.org/ * * Based on the Internet Junkbuster originally written @@ -206,7 +206,7 @@ static int match_sockaddr(const struct sockaddr_storage *network, return 0; } - /* TODO: Optimize by checking by words insted of octets */ + /* TODO: Optimize by checking by words instead of octets */ for (i = 0; (i < addr_len) && netmask_addr[i]; i++) { if ((network_addr[i] & netmask_addr[i]) != @@ -505,7 +505,7 @@ int acl_addr(const char *aspec, struct access_control_addr *aca) * * Description : Check to see if CONNECT requests to the destination * port of this request are forbidden. The check is - * independend of the actual request method. + * independent of the actual request method. * * Parameters : * 1 : csp = Current client state (buffers, headers, etc...) @@ -2166,7 +2166,11 @@ static jb_err prepare_for_filtering(struct client_state *csp) * If the body has a supported transfer-encoding, * decompress it, adjusting size and iob->eod. */ - if (csp->content_type & (CT_GZIP|CT_DEFLATE)) + if ((csp->content_type & (CT_GZIP|CT_DEFLATE)) +#ifdef FEATURE_BROTLI + || (csp->content_type & CT_BROTLI) +#endif + ) { if (0 == csp->iob->eod - csp->iob->cur) { @@ -2184,11 +2188,14 @@ static jb_err prepare_for_filtering(struct client_state *csp) else { /* - * Unset CT_GZIP and CT_DEFLATE to remember not - * to modify the Content-Encoding header later. + * Unset content types to remember not to + * modify the Content-Encoding header later. */ csp->content_type &= ~CT_GZIP; csp->content_type &= ~CT_DEFLATE; +#ifdef FEATURE_BROTLI + csp->content_type &= ~CT_BROTLI; +#endif } } #endif