symfony/symfony — Issue #3477: Bridge Monolog ChromePhp Handler
Author: maoueh
Created: 2012-02-29 23:22:21+00:00
State: open

Hi,

I'm facing a problem with the new ChromePhp handler that is in the Monolog bridge. In the brige, the header `X-ChromePhp-Data` is set via the `setHeader` response method (`$this->response->headers->set($header, $content);`). This method relies on the `HeaderBag` to set the header in the bag.

However, the `HeaderBag` will lower the header name (see [here](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/HttpFoundation/HeaderBag.php#L161)). This will then send the header `x-chromephp-data: ...` to the browser. Since the header name doesn't match what is expected by ChromePHP extension, nothing is print out to the Chrome debug console.

Sending the header directly like this ` header(self::HEADER_NAME . ': ' . $content);` solves the problem but it's just to prove that it works if the ChromePhpHandler doesn't pass by the `HeaderBag` helper. I'm unsure on how to solve this issue. Unless I'm wrong, I don't see an easy way to tell the `HeaderBag` to not lower the header name.

I could provide a PR if someone gets me in the good direction about how to solve this issue.

Regards,
Matt