Skip to content

Commit 4f64f71

Browse files
committed
Minor tweak
1 parent 0037654 commit 4f64f71

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

event_dispatcher.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ The most common way to listen to an event is to register an **event listener**::
4141
// Customize your response object to display the exception details
4242
$response = new Response();
4343
$response->setContent($message);
44+
// the exception message can contain unfiltered user input;
45+
// set the content-type to text to avoid XSS issues
4446
$response->headers->set('Content-Type', 'text/plain; charset=utf-8');
4547

4648
// HttpExceptionInterface is a special type of exception that

0 commit comments

Comments
 (0)