Commit 683d6ce9 authored by Hanno Schlichting's avatar Hanno Schlichting

Move httpexceptions middleware into ZPublisher.

parent cea2d056
......@@ -111,7 +111,7 @@ setup(
'main=Zope2.Startup.run:make_wsgi_app',
],
'paste.filter_app_factory': [
'httpexceptions=Zope2.Startup.httpexceptions:main',
'httpexceptions=ZPublisher.httpexceptions:main',
],
'console_scripts': [
'addzope2user=Zope2.utilities.adduser:main',
......
......@@ -24,7 +24,7 @@ from zope.interface import implements
from Testing.ZopeTestCase import interfaces
from Testing.ZopeTestCase import sandbox
from Zope2.Startup.httpexceptions import HTTPExceptionHandler
from ZPublisher.httpexceptions import HTTPExceptionHandler
def savestate(func):
......
......@@ -33,7 +33,7 @@ from Testing.ZopeTestCase import standard_permissions
from Testing.ZopeTestCase.sandbox import AppZapper
from Testing.ZopeTestCase.functional import ResponseWrapper
from Testing.ZopeTestCase.functional import savestate
from Zope2.Startup.httpexceptions import HTTPExceptionHandler
from ZPublisher.httpexceptions import HTTPExceptionHandler
if sys.version_info >= (3, ):
basestring = str
......
......@@ -292,10 +292,9 @@ def publish_module(environ, start_response,
status, headers = response.finalize()
start_response(status, headers)
body = response.body
if (isinstance(body, IOBase) or
IUnboundStreamIterator.providedBy(body)):
result = body
if (isinstance(response.body, IOBase) or
IUnboundStreamIterator.providedBy(response.body)):
result = response.body
else:
# If somebody used response.write, that data will be in the
# stdout StringIO, so we put that before the body.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment