~ubuntu-branches/ubuntu/trusty/quantum/trusty

« back to all changes in this revision

Viewing changes to quantum/wsgi.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2013-04-04 14:03:41 UTC
  • mfrom: (2.1.21)
  • Revision ID: package-import@ubuntu.com-20130404140341-l9fvwbr9039a3llu
Tags: 1:2013.1-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
235
235
    """Default JSON request body serialization"""
236
236
 
237
237
    def default(self, data):
238
 
        return jsonutils.dumps(data)
 
238
        def sanitizer(obj):
 
239
            return unicode(obj)
 
240
        return jsonutils.dumps(data, default=sanitizer)
239
241
 
240
242
 
241
243
class XMLDictSerializer(DictSerializer):
368
370
            LOG.debug(_("Data %(data)s type is %(type)s"),
369
371
                      {'data': data,
370
372
                       'type': type(data)})
371
 
            result.text = str(data)
 
373
            if isinstance(data, str):
 
374
                result.text = unicode(data, 'utf-8')
 
375
            else:
 
376
                result.text = unicode(data)
372
377
        return result
373
378
 
374
379
    def _create_link_nodes(self, xml_doc, links):