Skip to content

Commit

Permalink
Stop the profiler from profiling itself.
Browse files Browse the repository at this point in the history
This fix will allow the addition of the middleware in the appengine_config.py file, which is more convenient if handlers are split across many modules.
  • Loading branch information
csdigi committed Jun 30, 2011
1 parent fba4920 commit f6ea0fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.py
Expand Up @@ -14,6 +14,10 @@
def should_profile(environ):
user = users.get_current_user()

# Never profile calls to the profiler itself to avoid endless recursion.
if environ["PATH_INFO"].startswith("/gae_mini_profiler/"):
return False

if enable_profiler_admins and users.is_current_user_admin():
return True

Expand Down

0 comments on commit f6ea0fd

Please sign in to comment.