awsgi icon indicating copy to clipboard operation
awsgi copied to clipboard

headers not treated as case-insensitive (Content-Type)

Open fr-an-k opened this issue 3 years ago • 0 comments

In "use_binary_response", the header 'Content-Type' is read; however, HTTP headers are case insensitive (it fails in my case).

Can be fixed with something like this:

        content_type = None
        for item in headers.items():
            if item[0].lower() == 'content-type':
                content_type = item[1]
                break

fr-an-k avatar May 09 '22 12:05 fr-an-k