[icinga-checkins] icinga.org: icingaweb2/master: Response: Use method getHeader to check if Content-Type is set already

git at icinga.org git at icinga.org
Tue Oct 18 11:10:46 CEST 2016


Module: icingaweb2
Branch: master
Commit: e5c736aab4b707eba9288cf5e12ffda937bbc32b
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=e5c736aab4b707eba9288cf5e12ffda937bbc32b

Author: Noah Hilverling <noah.hilverling at netways.de>
Date:   Tue Oct 18 10:13:58 2016 +0200

Response: Use method getHeader to check if Content-Type is set already

refs #12161

---

 library/Icinga/Web/Response.php |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/library/Icinga/Web/Response.php b/library/Icinga/Web/Response.php
index 2a90a97..ac2573f 100644
--- a/library/Icinga/Web/Response.php
+++ b/library/Icinga/Web/Response.php
@@ -300,7 +300,9 @@ class Response extends Zend_Controller_Response_Http
             }
         }
 
-        $this->setHeader('Content-Type', $this->getContentType(), false);
+        if (!$this->getHeader('Content-Type', true)) {
+            $this->setHeader('Content-Type', $this->getContentType());
+        }
     }
 
     /**



More information about the icinga-checkins mailing list