Commits

Anonymous committed cb68b04

No longer use WebOb's wsgify decorator in both the injector and
delegator middlewares, as it has issues handling parent application
WSGI response (https://github.com/Pylons/webob/issues/74).

Comments (0)

Files changed (3)

 0.14 (unreleased)
 =================
 
-- Nothing changed yet.
-
+- No longer use WebOb's wsgify decorator in both the injector and
+  delegator middlewares, as it has issues handling parent application
+  WSGI response (https://github.com/Pylons/webob/issues/74).
 
 0.13.2 (2012-08-23)
 ===================

fanstatic/injector.py

 import webob
-import webob.dec
 
 from fanstatic.config import convert_config
 import fanstatic
 
         self.config = config
 
-    @webob.dec.wsgify
-    def __call__(self, request):
+    def __call__(self, environ, start_response):
+        request = webob.Request(environ)
         # We only continue if the request method is appropriate.
         if not request.method in ['GET', 'POST']:
-            return request.get_response(self.app)
+            return self.app(environ, start_response)
 
         # Initialize a needed resources object.
         # XXX this will set the needed on the thread local data, even
                 response.content_type.lower() in CONTENT_TYPES):
             # Clean up after our behinds.
             fanstatic.del_needed()
-            return response
+            return response(environ, start_response)
 
         # The wrapped application may have `needed` resources.
         if needed.has_resources():
         # Clean up after our behinds.
         fanstatic.del_needed()
 
-        return response
+        return response(environ, start_response)
 
 
 def make_injector(app, global_config, **local_config):

fanstatic/publisher.py

     def is_resource(self, request):
         return len(request.path_info.split(self.trigger)) > 1
 
-    @webob.dec.wsgify
-    def __call__(self, request):
+    def __call__(self, environ, start_response):
+        request = webob.Request(environ)
         if not self.is_resource(request):
             # the trigger segment is not in the URL, so we delegate
             # to the original application
-            return request.get_response(self.app)
+            return self.app(environ, start_response)
         # the trigger is in there, so let whatever is behind the
         # trigger be handled by the publisher
         ignored = request.path_info_pop()
         while ignored != self.publisher_signature:
             ignored = request.path_info_pop()
-        return request.get_response(self.publisher)
+        return self.publisher(environ, start_response)
 
 
 def make_publisher(app, global_config,