Skip to content

Transfer-encoding header is case sensitive #125

@jlemaes

Description

@jlemaes

We recently had an issue with requests that contained lowercase transfer-encoding: chunked header that's not correctly parsed by meinheld 1.0.2. We get a 400 response:

$ curl 'http://localhost:9000/' --header 'transfer-encoding: chunked' --data '' 
<html><head><title>Bad Request</title></head><body><p>Bad Request.</p></body></html>%  

while the uppercase header does get to the application:

$ curl 'http://localhost:9000/' --header 'Transfer-Encoding: chunked' --data ''
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>405 Method Not Allowed</title>
<h1>Method Not Allowed</h1>
<p>The method is not allowed for the requested URL.</p>

Checking the commits this seems to be the cause: 4155876.
Meinheld 1.0.1 did indeed parse both transfer-encoding: chunked and 'Transfer-Encoding: chunked' according to the rfc

Field names are case-insensitive.

Can this commit get reverted? I can create a PR if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions