Fix #4563
diff --git a/system/core/Input.php b/system/core/Input.php
index a7c9ecd..50ca047 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -760,30 +760,32 @@
 		// If header is already defined, return it immediately
 		if ( ! empty($this->headers))
 		{
-			return $this->headers;
+			return $this->_fetch_from_array($this->headers, NULL, $xss_clean);
 		}
 
 		// In Apache, you can simply call apache_request_headers()
 		if (function_exists('apache_request_headers'))
 		{
-			return $this->headers = apache_request_headers();
+			$this->headers = apache_request_headers();
 		}
-
-		$this->headers['Content-Type'] = isset($_SERVER['CONTENT_TYPE']) ? $_SERVER['CONTENT_TYPE'] : @getenv('CONTENT_TYPE');
-
-		foreach ($_SERVER as $key => $val)
+		else
 		{
-			if (sscanf($key, 'HTTP_%s', $header) === 1)
-			{
-				// take SOME_HEADER and turn it into Some-Header
-				$header = str_replace('_', ' ', strtolower($header));
-				$header = str_replace(' ', '-', ucwords($header));
+			isset($_SERVER['CONTENT_TYPE']) && $this->headers['Content-Type'] = $_SERVER['CONTENT_TYPE'];
 
-				$this->headers[$header] = $this->_fetch_from_array($_SERVER, $key, $xss_clean);
+			foreach ($_SERVER as $key => $val)
+			{
+				if (sscanf($key, 'HTTP_%s', $header) === 1)
+				{
+					// take SOME_HEADER and turn it into Some-Header
+					$header = str_replace('_', ' ', strtolower($header));
+					$header = str_replace(' ', '-', ucwords($header));
+
+					$this->headers[$header] = $_SERVER[$key];
+				}
 			}
 		}
 
-		return $this->headers;
+		return $this->_fetch_from_array($this->headers, NULL, $xss_clean);
 	}
 
 	// --------------------------------------------------------------------
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 40f7c13..5a48220 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -25,6 +25,7 @@
 -  Fixed a bug where :doc:`Image Manipulation Library <libraries/image_lib>` didn't escape image source paths passed to ImageMagick as shell arguments.
 -  Fixed a bug (#861) - :doc:`Database Forge <database/forge>` method ``create_table()`` incorrectly accepts field width constraints for MSSQL/SQLSRV integer-type columns.
 -  Fixed a bug (#4562) - :doc:`Cache Library <libraries/caching>` didn't check if ``Memcached::quit()`` is available before calling it.
+-  Fixed a bug (#4563) - :doc:`Input Library <libraries/input>` method ``request_headers()`` ignores ``$xss_clean`` parameter value after first call.
 
 Version 3.0.6
 =============