aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mediagoblin/app.py3
-rw-r--r--mediagoblin/tools/response.py6
2 files changed, 7 insertions, 2 deletions
diff --git a/mediagoblin/app.py b/mediagoblin/app.py
index 876ded4e..8bd2496f 100644
--- a/mediagoblin/app.py
+++ b/mediagoblin/app.py
@@ -193,7 +193,8 @@ class MediaGoblinApp(object):
except NotFound as exc:
return render_404(request)(environ, start_response)
except HTTPException as exc:
- # Support legacy webob.exc responses
+ # exceptions that match() is documented to return:
+ # MethodNotAllowed, RequestRedirect TODO: need to handle ???
return exc(environ, start_response)
view_func = view_functions[endpoint]
diff --git a/mediagoblin/tools/response.py b/mediagoblin/tools/response.py
index ed23f0f7..b02dd6b5 100644
--- a/mediagoblin/tools/response.py
+++ b/mediagoblin/tools/response.py
@@ -15,11 +15,15 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import werkzeug.utils
-from webob import Response
+from werkzeug.wrappers import Response as wz_Response
from mediagoblin.tools.template import render_template
from mediagoblin.tools.translate import (lazy_pass_to_ugettext as _,
pass_to_ugettext)
+class Response(wz_Response):
+ """Set default response mimetype to HTML, otherwise we get text/plain"""
+ default_mimetype = u'text/html'
+
def render_to_response(request, template, context, status=200):
"""Much like Django's shortcut.render()"""