Mercurial > cosocket
changeset 54:d1331955845f
JSON data is now sent w/ the proper mime type.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Tue, 28 Apr 2009 14:39:40 -0700 |
parents | 67ec969d4f0d |
children | 5e08a9f4730e |
files | openwebchat.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/openwebchat.py Tue Apr 28 14:12:46 2009 -0700 +++ b/openwebchat.py Tue Apr 28 14:39:40 2009 -0700 @@ -87,14 +87,14 @@ while 1: yield self._until_one_request_processed(addr) - def __multipart_boundary(self, boundary): + def __multipart_boundary(self, boundary, mimetype = 'application/json'): # Here we actually declare the content type and start the # transfer of the document itself; this is needed to # trigger an error on the browser-side, because a closed # connection during any other phase is unlikely to # cause any event to trigger on the client webpage. return '\r\n'.join(('--%s' % boundary, - 'Content-Type: text/plain', + 'Content-Type: %s' % mimetype, '', ''))