On Tue, Sep 17, 2013 at 10:52 PM, Yann Ylavic <[email protected]> wrote:

> On Tue, Sep 17, 2013 at 10:42 PM, Yann Ylavic <[email protected]>wrote:
>
>> On Tue, Sep 17, 2013 at 9:34 PM, Jim Jagielski <[email protected]> wrote:
>>
>>> Ahh... So none of this is really needed then. At least, it should
>>> be reverted.
>>>
>>>
>> Well, as I understand the "new rfc", the old code is broken too.
>>
>> However, the fix should not continue with the content-length (if any)
>> when the transfer-encoding is not (ended-by-)chunked, but return 400
>> instead (or 502 when it applies to a response).
>>
>
> Clearly, return 400/502 whenever an transfer-encoding is given and is not
> (ended-by-)chunked, am I missing something ?
>

Something like :

if ((tenc = apr_table_get(r->headers_in, "Transfer-Encoding"))) {
    if (strcasecmp(tenc, "chunked") != 0) {
        // ap_read_request => fail with 400
        // ap_http_filter => return APR_ENOTIMPL
    }
    apr_table_unset(r->headers_in, "Content-Length");
}

Reply via email to