def finalize_request(self, req, env): code = int(env['diesel.status'].split()[0]) heads = HttpHeaders() for n, v in env['diesel.response_headers']: heads.add(n, v) body = ''.join(env['diesel.output']) if 'Content-Length' not in heads: heads.set('Content-Length', len(body)) return http_response(req, code, heads, body)
def finalize_request(self, req): code = int(self.status.split()[0]) heads = HttpHeaders() for n, v in self.response_headers: heads.add(n, v) body = ''.join(self.outbuf) if 'Content-Length' not in heads: heads.set('Content-Length', len(body)) return http_response(req, code, heads, body)
def finalize_request(self, req): code = int(self.status.split()[0]) heads = HttpHeaders() for n, v in self.response_headers: heads.add(n, v) body = ''.join(self.outbuf) if 'Content-Length' not in heads: heads.set('Content-Length', len(body)) return http_response(req, code, heads, body)
def finalize_request(self, req, env): code = int(env['diesel.status'].split()[0]) heads = HttpHeaders() for n, v in env['diesel.response_headers']: heads.add(n, v) body = ''.join(env['diesel.output']) if 'Content-Length' not in heads: heads.set('Content-Length', len(body)) return http_response(req, code, heads, body)
def web_handler(req): heads = HttpHeaders() heads.add('Content-Length', len(content)) heads.add('Content-Type', 'text/html') return http_response(req, 200, heads, content)
def web_handler(req): heads = HttpHeaders() heads.add('Content-Length', len(content)) heads.add('Content-Type', 'text/html') return http_response(req, 200, heads, content)