(self)
| 124 | |
| 125 | class NoContentLengthHandler(RequestHandler): |
| 126 | def get(self): |
| 127 | if self.request.version.startswith("HTTP/1"): |
| 128 | # Emulate the old HTTP/1.0 behavior of returning a body with no |
| 129 | # content-length. Tornado handles content-length at the framework |
| 130 | # level so we have to go around it. |
| 131 | stream = self.detach() |
| 132 | stream.write(b"HTTP/1.0 200 OK\r\n\r\n" b"hello") |
| 133 | stream.close() |
| 134 | else: |
| 135 | self.finish("HTTP/1 required") |
| 136 | |
| 137 | |
| 138 | class EchoPostHandler(RequestHandler): |