--- wsgifilter/filter.py.orig	2008-06-23 12:31:07.000000000 -0400
+++ wsgifilter/filter.py	2008-06-23 12:31:13.000000000 -0400
@@ -75,7 +75,7 @@
         if shortcutted:
             # We chose not to filter
             return app_iter
-        if not captured or written_output:
+        if (not captured) or written_output:
             # This app hasn't called start_response We can't do
             # anything magic with it; or it used the start_response
             # writer, and we still can't do anything with it
@@ -86,6 +86,9 @@
                 if hasattr(app_iter, 'close'):
                     app_iter.close()
             app_iter = written_output
+        if shortcutted:
+            # We chose not to filter (delayed due to RHS generator)
+            return app_iter
         try:
             return self.filter_output(
                 environ, start_response,

