@@ -88,7 +88,7 @@ public function panelAction(Request $request, $token)
8888 }
8989
9090 if (!$ profile = $ this ->profiler ->loadProfile ($ token )) {
91- return new Response ( $ this ->twig -> render ( '@WebProfiler/Profiler/info.html.twig ' , ['about ' => 'no_token ' , 'token ' => $ token , 'request ' => $ request]), 200 , [ ' Content-Type ' => ' text/html ' ]);
91+ return $ this ->renderWithCspNonces ( $ request , '@WebProfiler/Profiler/info.html.twig ' , ['about ' => 'no_token ' , 'token ' => $ token , 'request ' => $ request ]);
9292 }
9393
9494 if (null === $ panel ) {
@@ -111,7 +111,7 @@ public function panelAction(Request $request, $token)
111111 throw new NotFoundHttpException (sprintf ('Panel "%s" is not available for token "%s". ' , $ panel , $ token ));
112112 }
113113
114- return new Response ( $ this ->twig -> render ( $ this ->getTemplateManager ()->getName ($ profile , $ panel ), [
114+ return $ this ->renderWithCspNonces ( $ request , $ this ->getTemplateManager ()->getName ($ profile , $ panel ), [
115115 'token ' => $ token ,
116116 'profile ' => $ profile ,
117117 'collector ' => $ profile ->getCollector ($ panel ),
@@ -121,7 +121,7 @@ public function panelAction(Request $request, $token)
121121 'templates ' => $ this ->getTemplateManager ()->getNames ($ profile ),
122122 'is_ajax ' => $ request ->isXmlHttpRequest (),
123123 'profiler_markup_version ' => 2 , // 1 = original profiler, 2 = Symfony 2.8+ profiler
124- ]), 200 , [ ' Content-Type ' => ' text/html ' ]) ;
124+ ]);
125125 }
126126
127127 /**
@@ -252,7 +252,7 @@ public function searchResultsAction(Request $request, $token)
252252 $ end = $ request ->query ->get ('end ' , null );
253253 $ limit = $ request ->query ->get ('limit ' );
254254
255- return new Response ( $ this ->twig -> render ( '@WebProfiler/Profiler/results.html.twig ' , [
255+ return $ this ->renderWithCspNonces ( $ request , '@WebProfiler/Profiler/results.html.twig ' , [
256256 'request ' => $ request ,
257257 'token ' => $ token ,
258258 'profile ' => $ profile ,
@@ -265,7 +265,7 @@ public function searchResultsAction(Request $request, $token)
265265 'end ' => $ end ,
266266 'limit ' => $ limit ,
267267 'panel ' => null ,
268- ]), 200 , [ ' Content-Type ' => ' text/html ' ]) ;
268+ ]);
269269 }
270270
271271 /**
@@ -367,11 +367,11 @@ public function openAction(Request $request)
367367 throw new NotFoundHttpException (sprintf ('The file "%s" cannot be opened. ' , $ file ));
368368 }
369369
370- return new Response ( $ this ->twig -> render ( '@WebProfiler/Profiler/open.html.twig ' , [
370+ return $ this ->renderWithCspNonces ( $ request , '@WebProfiler/Profiler/open.html.twig ' , [
371371 'filename ' => $ filename ,
372372 'file ' => $ file ,
373373 'line ' => $ line ,
374- ]), 200 , [ ' Content-Type ' => ' text/html ' ]);
374+ ]);
375375 }
376376
377377 /**
0 commit comments