Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 3867:2563ddf71cd7
Enabled over-riding of content-type in web interface (thanks John Mitchell)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 27 Aug 2007 10:27:31 +0000 |
| parents | 36eb9e8faf30 |
| children | fca0365521fc |
comparison
equal
deleted
inserted
replaced
| 3866:faca7a91246b | 3867:2563ddf71cd7 |
|---|---|
| 1 # $Id: client.py,v 1.233 2007-01-16 10:16:08 schlatterbeck Exp $ | 1 # $Id: client.py,v 1.234 2007-08-27 10:27:31 richard Exp $ |
| 2 | 2 |
| 3 """WWW request handler (also used in the stand-alone server). | 3 """WWW request handler (also used in the stand-alone server). |
| 4 """ | 4 """ |
| 5 __docformat__ = 'restructuredtext' | 5 __docformat__ = 'restructuredtext' |
| 6 | 6 |
| 863 self._socket_op(self.request.wfile.write, content) | 863 self._socket_op(self.request.wfile.write, content) |
| 864 | 864 |
| 865 def write_html(self, content): | 865 def write_html(self, content): |
| 866 if not self.headers_done: | 866 if not self.headers_done: |
| 867 # at this point, we are sure about Content-Type | 867 # at this point, we are sure about Content-Type |
| 868 self.additional_headers['Content-Type'] = \ | 868 if not self.additional_headers.has_key('Content-Type'): |
| 869 'text/html; charset=%s' % self.charset | 869 self.additional_headers['Content-Type'] = \ |
| 870 'text/html; charset=%s' % self.charset | |
| 870 self.header() | 871 self.header() |
| 871 | 872 |
| 872 if self.env['REQUEST_METHOD'] == 'HEAD': | 873 if self.env['REQUEST_METHOD'] == 'HEAD': |
| 873 # client doesn't care about content | 874 # client doesn't care about content |
| 874 return | 875 return |
