diff options
| author | Aymeric Augustin | 2013-10-15 10:01:47 +0200 | 
|---|---|---|
| committer | Aymeric Augustin | 2013-10-15 10:02:34 +0200 | 
| commit | 142caaa979645ff78b1928a018bb0a83e02a4218 (patch) | |
| tree | c79515f78bacc4117ad90f256e177cfb86e9dc38 /debug_toolbar/middleware.py | |
| parent | 0bd0abda661af29750bbd3263ab5f93a24b47511 (diff) | |
| download | django-debug-toolbar-142caaa979645ff78b1928a018bb0a83e02a4218.tar.bz2 | |
Disable insertion in streaming responses.
Diffstat (limited to 'debug_toolbar/middleware.py')
| -rw-r--r-- | debug_toolbar/middleware.py | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index 1ad1942..090e206 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -117,10 +117,10 @@ class DebugToolbarMiddleware(object):          __traceback_hide__ = True          ident = threading.currentThread().ident          toolbar = self.__class__.debug_toolbars.get(ident) -        if not toolbar or request.is_ajax(): +        if not toolbar or request.is_ajax() or getattr(response, 'streaming', False):              return response          if isinstance(response, HttpResponseRedirect): -            if not toolbar.config['INTERCEPT_REDIRECTS'] or request.is_ajax(): +            if not toolbar.config['INTERCEPT_REDIRECTS']:                  return response              redirect_to = response.get('Location', None)              if redirect_to: | 
