aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAymeric Augustin2013-10-15 10:01:47 +0200
committerAymeric Augustin2013-10-15 10:02:34 +0200
commit142caaa979645ff78b1928a018bb0a83e02a4218 (patch)
treec79515f78bacc4117ad90f256e177cfb86e9dc38
parent0bd0abda661af29750bbd3263ab5f93a24b47511 (diff)
downloaddjango-debug-toolbar-142caaa979645ff78b1928a018bb0a83e02a4218.tar.bz2
Disable insertion in streaming responses.
-rw-r--r--debug_toolbar/middleware.py4
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:
='n152' href='#n152'>152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311