|
@@ -42,6 +42,12 @@ class FirePHPHandler extends BaseFirePHPHandler
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (!preg_match('{\bFirePHP/\d+\.\d+\b}', $event->getRequest()->headers->get('User-Agent'))) {
|
|
|
|
+ $this->sendHeaders = false;
|
|
|
|
+ $this->headers = array();
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
$this->response = $event->getResponse();
|
|
$this->response = $event->getResponse();
|
|
foreach ($this->headers as $header => $content) {
|
|
foreach ($this->headers as $header => $content) {
|
|
$this->response->headers->set($header, $content);
|
|
$this->response->headers->set($header, $content);
|
|
@@ -54,10 +60,22 @@ class FirePHPHandler extends BaseFirePHPHandler
|
|
*/
|
|
*/
|
|
protected function sendHeader($header, $content)
|
|
protected function sendHeader($header, $content)
|
|
{
|
|
{
|
|
|
|
+ if (!$this->sendHeaders) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
if ($this->response) {
|
|
if ($this->response) {
|
|
$this->response->headers->set($header, $content);
|
|
$this->response->headers->set($header, $content);
|
|
} else {
|
|
} else {
|
|
$this->headers[$header] = $content;
|
|
$this->headers[$header] = $content;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * Override default behavior since we check the user agent in onKernelResponse
|
|
|
|
+ */
|
|
|
|
+ protected function headersAccepted()
|
|
|
|
+ {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
}
|
|
}
|