|
26 | 26 | class CP3FilterChainProxy(FilterChainProxy): |
27 | 27 | def __init__(self, filterInvocationDefinitionSource=None): |
28 | 28 | FilterChainProxy.__init__(self, filterInvocationDefinitionSource) |
29 | | - self.logger = logging.getLogger("springpython.security.cherrypy3.CP3FilterChainProxy") |
30 | | - cherrypy.tools.filterChainProxy = cherrypy._cptools.HandlerTool(self) |
| 29 | + self.logger = logging.getLogger("springpython.security.cherrypy3.Another") |
| 30 | + cherrypy.tools.securityFilterChain = cherrypy._cptools.HandlerTool(self) |
31 | 31 |
|
32 | 32 | def __call__(self, environ=None, start_response=None): |
33 | | - innerfunc = cherrypy.request.handler |
34 | | - def mini_app(*args, **kwargs): |
35 | | - def cherrypy_wrapper(nexthandler, *args, **kwargs): |
36 | | - results = nexthandler(*args, **kwargs) |
37 | | - self.logger.debug("Results = %s" % results) |
38 | | - return results |
39 | | - return cherrypy_wrapper(innerfunc, *args, **kwargs) |
| 33 | + if cherrypy.request.handler is None: |
| 34 | + return False |
40 | 35 |
|
41 | | - self.application = (self.invoke, (mini_app,)) |
| 36 | + def cherrypy_handler(*args, **kwargs): |
| 37 | + return cherrypy.request.handler(*args, **kwargs) |
42 | 38 |
|
43 | | - # Store the final results... |
| 39 | + def func(args): |
| 40 | + return args[0]() |
| 41 | + |
| 42 | + self.application = (func, (cherrypy_handler,)) |
44 | 43 | cherrypy.response.body = FilterChainProxy.__call__(self, cherrypy.request.wsgi_environ, None) |
45 | | - #...and then signal there is no more handling for CherryPy to do. |
46 | 44 | return True |
47 | 45 |
|
48 | | - def invoke(self, args): |
49 | | - return args[0]() |
50 | | - |
51 | 46 | class CP3SessionStrategy(SessionStrategy): |
52 | 47 | def __init__(self): |
53 | 48 | SessionStrategy.__init__(self) |
|
0 commit comments