95129c7f34a5ae4090a0e4a3badab075485edd2d
[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  2006-02-05 16:23:12.000000000 +0100
11 +++ privoxy/parsers.c   2006-02-05 16:25:49.000000000 +0100
12 @@ -871,8 +871,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 @@ -904,13 +903,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 -         return (header == NULL) ? JB_ERR_MEMORY : JB_ERR_OK;
36        }
37     }
38