Skip to content

WSGIContainer does not support Keep-Alive #374

davidgaleano opened this Issue Oct 5, 2011 · 1 comment

3 participants


Apache Benchmark hangs when setting option -k if using FallbackHandler to a WSGIContainer.

I think the problem is that WSGIContainer does not set a Connection header when the request does not support HTTP 1.1.

Copying the code that sets the headers from RequestHandler.clear to WSGIContainer.__call__ fixes the issue:

        if not request.supports_http_1_1():
            if request.headers.get("Connection", '').lower() == "keep-alive":
                headers.append(("Connection", "Keep-Alive"))

Btw, I have seen some clients sending a lowercase value for Keep-Alive, so I also suggest doing .lower() == "keep-alive" on RequestHandler.clear.

mitar commented Oct 27, 2012

It seems calling .clear() would also fix #619.

@bdarnell bdarnell added the wsgi label Jul 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.