| 389 | return True |
| 390 | |
| 391 | def default_headers(self): |
| 392 | # set the connection header |
| 393 | if self.upgrade: |
| 394 | connection = "upgrade" |
| 395 | elif self.should_close(): |
| 396 | connection = "close" |
| 397 | else: |
| 398 | connection = "keep-alive" |
| 399 | |
| 400 | headers = [ |
| 401 | "HTTP/%s.%s %s\r\n" % (self.req.version[0], |
| 402 | self.req.version[1], self.status), |
| 403 | "Server: %s\r\n" % self.version, |
| 404 | "Date: %s\r\n" % util.http_date(), |
| 405 | "Connection: %s\r\n" % connection |
| 406 | ] |
| 407 | if self.chunked: |
| 408 | headers.append("Transfer-Encoding: chunked\r\n") |
| 409 | return headers |
| 410 | |
| 411 | def send_headers(self): |
| 412 | if self.headers_sent: |