Commits

Ben Bangert committed 83441de

* WARNING: Session middleware no longer catches Paste HTTP Exceptions, apps
are now expected to capture and handle Paste HTTP Exceptions themselves.

  • Participants
  • Parent commits 936d4cb

Comments (0)

Files changed (2)

 Beaker Changelog
 ================
 
-0.9.2.1 (**tip**)
+0.9.3 (**tip**)
+* WARNING: Session middleware no longer catches Paste HTTP Exceptions, apps
+  are now expected to capture and handle Paste HTTP Exceptions themselves.
 * Fixed Python 2.4 compatibility bug in hmac.
 * Fixed key lookup bug on cache object to only use the settings for the key
   lookup. Found by Andrew Stromnov.

File beaker/middleware.py

                     if cookie:
                         headers.append(('Set-cookie', cookie))
             return start_response(status, headers, exc_info)
-        try:
-            response = self.wrap_app(environ, session_start_response)
-        except:
-            ty, val = sys.exc_info()[:2]
-            if isinstance(ty, str):
-                raise ty, val, sys.exc_info()[2]
-            if ty.__name__ == 'HTTPFound' and \
-                    session.__dict__['_sess'] is not None:
-                cookie = session.__dict__['_headers']['cookie_out']
-                if cookie:
-                    val.headers.append(('Set-cookie', cookie))
-            raise ty, val, sys.exc_info()[2]
-        else:
-            return response
+        return self.wrap_app(environ, session_start_response)
     
     def _get_session(self):
         return Session({}, use_cookies=False, **self.options)