@@ -83,7 +83,7 @@ public function panelAction(Request $request, string $token): Response
83
83
}
84
84
85
85
if (!$ profile = $ this ->profiler ->loadProfile ($ token )) {
86
- return new Response ( $ this ->twig -> render ( '@WebProfiler/Profiler/info.html.twig ' , ['about ' => 'no_token ' , 'token ' => $ token , 'request ' => $ request]), 200 , [ ' Content-Type ' => ' text/html ' ]);
86
+ return $ this ->renderWithCspNonces ( $ request , '@WebProfiler/Profiler/info.html.twig ' , ['about ' => 'no_token ' , 'token ' => $ token , 'request ' => $ request ]);
87
87
}
88
88
89
89
if (null === $ panel ) {
@@ -106,7 +106,7 @@ public function panelAction(Request $request, string $token): Response
106
106
throw new NotFoundHttpException (sprintf ('Panel "%s" is not available for token "%s". ' , $ panel , $ token ));
107
107
}
108
108
109
- return new Response ( $ this ->twig -> render ( $ this ->getTemplateManager ()->getName ($ profile , $ panel ), [
109
+ return $ this ->renderWithCspNonces ( $ request , $ this ->getTemplateManager ()->getName ($ profile , $ panel ), [
110
110
'token ' => $ token ,
111
111
'profile ' => $ profile ,
112
112
'collector ' => $ profile ->getCollector ($ panel ),
@@ -116,7 +116,7 @@ public function panelAction(Request $request, string $token): Response
116
116
'templates ' => $ this ->getTemplateManager ()->getNames ($ profile ),
117
117
'is_ajax ' => $ request ->isXmlHttpRequest (),
118
118
'profiler_markup_version ' => 2 , // 1 = original profiler, 2 = Symfony 2.8+ profiler
119
- ]), 200 , [ ' Content-Type ' => ' text/html ' ]) ;
119
+ ]);
120
120
}
121
121
122
122
/**
@@ -238,7 +238,7 @@ public function searchResultsAction(Request $request, string $token): Response
238
238
$ end = $ request ->query ->get ('end ' , null );
239
239
$ limit = $ request ->query ->get ('limit ' );
240
240
241
- return new Response ( $ this ->twig -> render ( '@WebProfiler/Profiler/results.html.twig ' , [
241
+ return $ this ->renderWithCspNonces ( $ request , '@WebProfiler/Profiler/results.html.twig ' , [
242
242
'request ' => $ request ,
243
243
'token ' => $ token ,
244
244
'profile ' => $ profile ,
@@ -251,7 +251,7 @@ public function searchResultsAction(Request $request, string $token): Response
251
251
'end ' => $ end ,
252
252
'limit ' => $ limit ,
253
253
'panel ' => null ,
254
- ]), 200 , [ ' Content-Type ' => ' text/html ' ]) ;
254
+ ]);
255
255
}
256
256
257
257
/**
@@ -347,11 +347,11 @@ public function openAction(Request $request): Response
347
347
throw new NotFoundHttpException (sprintf ('The file "%s" cannot be opened. ' , $ file ));
348
348
}
349
349
350
- return new Response ( $ this ->twig -> render ( '@WebProfiler/Profiler/open.html.twig ' , [
350
+ return $ this ->renderWithCspNonces ( $ request , '@WebProfiler/Profiler/open.html.twig ' , [
351
351
'filename ' => $ filename ,
352
352
'file ' => $ file ,
353
353
'line ' => $ line ,
354
- ]), 200 , [ ' Content-Type ' => ' text/html ' ]);
354
+ ]);
355
355
}
356
356
357
357
/**
0 commit comments