From c8cf2256655ee4b34ec501325b9016608b5cce5f Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 15 Jan 2009 00:20:04 +0000 Subject: - Instead of invariably using ``webob.Request`` as the "request factory" (e.g. in the ``Router`` class) and ``webob.Response`` and the "response factory" (e.g. in ``render_template_to_response``), allow both to be overridden via a ZCML utility hook. See the "Using ZCML Hooks" chapter of the documentation for more information. --- repoze/bfg/wsgi.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'repoze/bfg/wsgi.py') diff --git a/repoze/bfg/wsgi.py b/repoze/bfg/wsgi.py index 149273c27..93b2c143b 100644 --- a/repoze/bfg/wsgi.py +++ b/repoze/bfg/wsgi.py @@ -1,3 +1,7 @@ +from zope.component import queryUtility + +from repoze.bfg.interfaces import IResponseFactory + from webob import Response try: from functools import wraps @@ -37,7 +41,8 @@ def wsgiapp(wrapped): body = wrapped(environ, catch_start_response) if caught: status, headers, exc_info = caught - response = Response() + response_factory = queryUtility(IResponseFactory, default=Response) + response = response_factory() response.app_iter = body response.status = status response.headerlist = headers -- cgit v1.2.3