[icinga-checkins] icinga.org: icingaweb2/master: Response: Add contentType attribute

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


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

Author: Noah Hilverling <noah.hilverling at netways.de>
Date:   Fri Oct 14 16:12:47 2016 +0200

Response: Add contentType attribute

refs #12161

---

 library/Icinga/Web/Response.php |   31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/library/Icinga/Web/Response.php b/library/Icinga/Web/Response.php
index af3e1e2..71536c2 100644
--- a/library/Icinga/Web/Response.php
+++ b/library/Icinga/Web/Response.php
@@ -55,6 +55,13 @@ class Response extends Zend_Controller_Response_Http
     protected $rerenderLayout = false;
 
     /**
+     * Content type of this response
+     *
+     * @var string
+     */
+    protected $contentType = 'text/html';
+
+    /**
      * Get the auto-refresh interval
      *
      * @return int
@@ -206,6 +213,30 @@ class Response extends Zend_Controller_Response_Http
     }
 
     /**
+     * Set the content type of this response
+     *
+     * @param  string $contentType
+     *
+     * @return $this
+     */
+    public function setContentType($contentType)
+    {
+        $this->contentType = $contentType;
+        return $this;
+    }
+
+    /**
+     * Get the content type of this response
+     *
+     * @return string
+     */
+    public function getContentType()
+    {
+        return $this->contentType;
+    }
+
+
+    /**
      * Entry point for HTTP responses in JSON format
      *
      * @return JsonResponse



More information about the icinga-checkins mailing list