@@ -49,8 +49,6 @@ def __call__(self, request):
4949
5050 toolbar = DebugToolbar (request , self .get_response )
5151
52- self .configure_toolbar (request , toolbar )
53-
5452 # Activate instrumentation ie. monkey-patch.
5553 for panel in toolbar .enabled_panels :
5654 panel .enable_instrumentation ()
@@ -85,17 +83,6 @@ def __call__(self, request):
8583 ):
8684 return response
8785
88- response , did_insert = self .insert_toolbar (request , response , rendered )
89- if did_insert :
90- if "Content-Length" in response :
91- response ["Content-Length" ] = len (response .content )
92- return response
93-
94- def configure_toolbar (self , request , toolbar ):
95- pass
96-
97- @staticmethod
98- def insert_toolbar (request , response , rendered ):
9986 # Insert the toolbar in the response.
10087 content = response .content .decode (response .charset )
10188 insert_before = dt_settings .get_config ()["INSERT_BEFORE" ]
@@ -104,8 +91,9 @@ def insert_toolbar(request, response, rendered):
10491 if len (bits ) > 1 :
10592 bits [- 2 ] += rendered
10693 response .content = insert_before .join (bits )
107- return response , True
108- return response , False
94+ if "Content-Length" in response :
95+ response ["Content-Length" ] = len (response .content )
96+ return response
10997
11098 @staticmethod
11199 def generate_server_timing_header (response , panels ):
0 commit comments