We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c6dbbc commit 384d144Copy full SHA for 384d144
debug_toolbar/middleware.py
@@ -62,10 +62,8 @@ def _show_toolbar(self, request):
62
remote_addr = x_forwarded_for.split(',')[0].strip()
63
else:
64
remote_addr = request.META.get('REMOTE_ADDR', None)
65
- if not remote_addr in settings.INTERNAL_IPS \
66
- or (request.is_ajax() and \
67
- not debug_toolbar.urls._PREFIX in request.path) \
68
- or not (settings.DEBUG and not getattr(settings, 'TEST', False)):
+ # if not internal ip, and not DEBUG or TEST
+ if not (remote_addr in settings.INTERNAL_IPS or settings.DEBUG or getattr(settings, 'TEST', False)):
69
return False
70
return True
71
0 commit comments