In #6778 we found that AWS forwards HTTP headers to Lambdas from clients without modifying their casing. Since users are relying on this behavior, it effectively renders a web server that lowercases headers unusable as proxy for localstack. In general, I think there is a case to be made that web servers should not manipulate the casing of request headers, so that they can function as application-layer proxy to backends that make assumptions about header casing.

The issue of header casing for HTTP/1.1 in hypercorn was addressed with https://github.com/pgjones/hypercorn/issues/66, but later reverted with https://github.com/pgjones/hypercorn/issues/77. Apparently the relevant ASGI spec is being discussed here https://github.com/django/asgiref/issues/246 where I think we should make that case.

If this is a fundamental limitation of ASGI and we cannot get this into hypercorn, then we will be forced to either
- apologize to lambda users and tell them that they need to re-write their lambda code in a way that treats headers in a case-insensitive way
- fork hypercorn and maintain our own version
- use another webserver that does not manipulate HTTP headers, or at least allows access to the raw headers in some way
try:
            return await _close_orig(self)
        except ssl.SSLError:
            return
    _close_orig = tcp_server.TCPServer._close
    tcp_server.TCPServer._close = _close
    
    def create_ssl_context(self, *args, **kwargs):
        with SSL_LOCK:
            key = "%s%s" % (self.certfile, self.keyfile)
            if key not in SSL_CONTEXTS:
                
                def _do_create():
                    SSL_CONTEXTS[key] = create_ssl_context_orig(self, *args, **kwargs)
                retry(_do_create, retries=3, sleep=0.5)
            return SSL_CONTEXTS[key]
    create_ssl_context_orig = Config.create_ssl_context
    Config.create_ssl_context = create_ssl_context
    
    def _encode_headers(headers):
        if RETURN_CASE_SENSITIVE_HEADERS:
            return [(key.encode(), value.encode()) for key, value in headers.items()]
        return [(key.lower().encode(), value.encode()) for key, value in headers.items()]
    quart_asgi._encode_headers = quart_asgi.encode_headers = _encode_headers
    quart_app.encode_headers = quart_utils.encode_headers = _encode_headers
    def build_and_validate_headers(headers):