diff --git a/event_dispatcher.rst b/event_dispatcher.rst index ab3428f6cb0..0a41064ad79 100644 --- a/event_dispatcher.rst +++ b/event_dispatcher.rst @@ -41,6 +41,7 @@ The most common way to listen to an event is to register an **event listener**:: // Customize your response object to display the exception details $response = new Response(); $response->setContent($message); + $response->headers->set('Content-Type', 'text/plain; charset=utf-8'); // HttpExceptionInterface is a special type of exception that // holds status code and header details