summaryrefslogtreecommitdiffstats
path: root/system/core
diff options
context:
space:
mode:
Diffstat (limited to 'system/core')
-rw-r--r--system/core/Input.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/system/core/Input.php b/system/core/Input.php
index 31bd7008b..7a6b6e4e0 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -790,10 +790,16 @@ class CI_Input {
*/
public function request_headers($xss_clean = FALSE)
{
+ // If header is already defined, return it immediately
+ if ( ! empty($this->headers))
+ {
+ return $this->headers;
+ }
+
// In Apache, you can simply call apache_request_headers()
if (function_exists('apache_request_headers'))
{
- $this->headers = apache_request_headers();
+ return $this->headers = apache_request_headers();
}
else
{
@@ -810,7 +816,7 @@ class CI_Input {
// take SOME_HEADER and turn it into Some-Header
foreach ($headers as $key => $val)
{
- $key = str_replace('_', ' ', strtolower($key));
+ $key = str_replace(array('_', '-'), ' ', strtolower($key));
$key = str_replace(' ', '-', ucwords($key));
$this->headers[$key] = $val;