From cc824c55f4db771dac46a0e70939ba956e85a076 Mon Sep 17 00:00:00 2001 From: ianb Date: Mon, 13 Jun 2005 01:49:54 +0000 Subject: Put in a check for loops when using the application hook --- paste/urlparser.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'paste/urlparser.py') diff --git a/paste/urlparser.py b/paste/urlparser.py index 324447c..41d1877 100644 --- a/paste/urlparser.py +++ b/paste/urlparser.py @@ -170,7 +170,9 @@ class URLParser(object): def find_application(self, environ): if (self.init_module - and getattr(self.init_module, 'application', None)): + and getattr(self.init_module, 'application', None) + and not environ.get('paste.urlparser.init_application') == environ['SCRIPT_NAME']): + environ['paste.urlparser.init_application'] = environ['SCRIPT_NAME'] return self.init_module.application name, rest_of_path = wsgilib.path_info_split(environ['PATH_INFO']) environ['PATH_INFO'] = rest_of_path -- cgit v1.2.1