diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-02-08 22:25:35 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-02-08 22:25:35 +0000 |
| commit | 738e2ec8e4244fbe2c032145fca5889799ecf8a4 (patch) | |
| tree | 853ed994ae2e6c71a869fa6fb3d4420db37fe159 /keystone/common | |
| parent | 2cc97c19fb242128d760554324136cb6b500f479 (diff) | |
| parent | 6013dd83bb96bc1f654fb8a0d7e7b29c25bfa36a (diff) | |
Merge "Add content-type to responses" into redux
Diffstat (limited to 'keystone/common')
| -rw-r--r-- | keystone/common/wsgi.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/keystone/common/wsgi.py b/keystone/common/wsgi.py index c52df414..59b49de2 100644 --- a/keystone/common/wsgi.py +++ b/keystone/common/wsgi.py @@ -180,10 +180,13 @@ class Application(BaseApplication): elif isinstance(result, webob.exc.WSGIHTTPException): return result - return self._serialize(result) + response = webob.Response() + self._serialize(response, result) + return response - def _serialize(self, result): - return json.dumps(result, cls=utils.SmarterEncoder) + def _serialize(self, response, result): + response.content_type = 'application/json' + response.body = json.dumps(result, cls=utils.SmarterEncoder) def _normalize_arg(self, arg): return str(arg).replace(':', '_').replace('-', '_') |
