From cc195d5b821319732038fbd5d13bcc8b5a951ffc Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Fri, 16 Nov 2012 11:31:16 +0100 Subject: [PATCH] plugins/api: webob.Response -> werkzeug.Response --- mediagoblin/plugins/api/tools.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mediagoblin/plugins/api/tools.py b/mediagoblin/plugins/api/tools.py index 333a5682..0ef91127 100644 --- a/mediagoblin/plugins/api/tools.py +++ b/mediagoblin/plugins/api/tools.py @@ -18,10 +18,9 @@ import logging import json from functools import wraps -from webob import Response from urlparse import urljoin from werkzeug.exceptions import Forbidden - +from werkzeug.wrappers import Response from mediagoblin import mg_globals from mediagoblin.tools.pluginapi import PluginManager from mediagoblin.storage.filestorage import BasicFileStorage @@ -55,16 +54,15 @@ class Auth(object): def json_response(serializable, _disable_cors=False, *args, **kw): ''' - Serializes a json objects and returns a webob.Response object with the + Serializes a json objects and returns a werkzeug Response object with the serialized value as the response body and Content-Type: application/json. :param serializable: A json-serializable object Any extra arguments and keyword arguments are passed to the - webob.Response.__init__ method. + Response.__init__ method. ''' - response = Response(json.dumps(serializable), *args, **kw) - response.headers['Content-Type'] = 'application/json' + response = Response(json.dumps(serializable), *args, content_type='application/json', **kw) if not _disable_cors: cors_headers = { -- 2.25.1