b3458fdb99a06a77120077e7ca40528fb5df57b5
[privoxy.git] / debian / patches / 09_no_identity.dpatch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 09_no_identity.dpatch by Michael Shields <shields@msrl.com>
3 ##
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: After dechunking remove the "chunked"-header instead of replacing it
6 ## DP: by an "identity" header. (#318683).
7
8 @DPATCH@
9 diff -urNad privoxy~/parsers.c privoxy/parsers.c
10 --- privoxy~/parsers.c
11 +++ privoxy/parsers.c
12 @@ -1248,8 +1248,7 @@
13   *
14   * Description :  - Prohibit filtering (CT_TABOO) if transfer coding compresses
15   *                - Raise the CSP_FLAG_CHUNKED flag if coding is "chunked"
16 - *                - Change from "chunked" to "identity" if body was chunked
17 - *                  but has been de-chunked for filtering.
18 + *                - Remove if chunked body was de-chunked for filtering.
19   *
20   * Parameters  :
21   *          1  :  csp = Current client state (buffers, headers, etc...)
22 @@ -1281,14 +1280,13 @@
23  
24        /*
25         * If the body was modified, it has been
26 -       * de-chunked first, so adjust the header:
27 +       * de-chunked first, so remove the header.
28 +       * Don't use "identity" encoding, which was included in
29 +       * RFC 2616 by mistake (http://purl.org/NET/http-errata#identity).
30         */
31        if (csp->flags & CSP_FLAG_MODIFIED)
32        {
33           freez(*header);
34 -         *header = strdup("Transfer-Encoding: identity");
35 -         log_error(LOG_LEVEL_HEADER, "Set: %s", *header);
36 -         return (header == NULL) ? JB_ERR_MEMORY : JB_ERR_OK;
37        }
38     }
39