def application(self, environ, start_response): try: host, port = get_destination(environ) except Exception, e: log.error("[Exception][http]: %s" % str(e)) start_response("400 Bad Request", [("Content-Type", "text/plain; charset=utf-8")]) return ["Bad Request"]
def http(self, environ, start_response): try: method, url, body, headers = copy_request(environ) host, port = get_destination(environ) except Exception, e: log.error("[Exception][http]: %s" % str(e)) start_response("400 Bad Request", [("Content-Type", "text/plain; charset=utf-8")]) yield "Bad Request" return