photon
4/1/2014 - 8:21 AM

refactor def clear in web.py of tornado

The following lines could be moved to a separate function from def clear

line 248:
        if (not self.request.supports_http_1_1() and
            getattr(self.request, 'connection', None) and
                not self.request.connection.no_keep_alive):
            conn_header = self.request.headers.get("Connection")
            if conn_header and (conn_header.lower() == "keep-alive"):
                self._headers["Connection"] = "Keep-Alive"

https://github.com/facebook/tornado/blob/master/tornado/web.py