diff options
author | Achraf Almouloudi <achraf52@outlook.com> | 2020-02-10 01:00:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-10 01:00:33 +0100 |
commit | 6fdf0d6e67a3a5c9113afb2d64dc9fd3725f859d (patch) | |
tree | 9908938b5a01e2dbabd4822d992068f9bf868b79 /system | |
parent | 2ad24af488da7dc518684cc146914b2937749031 (diff) |
Add server protocol value variation
In some Apache servers running the HTTP/2 protocol, calling "$_SERVER['SERVER_PROTOCOL']" may return "HTTP/2.0" instead, thus causing CodeIgniter to (incorrectly) determine the output header protocol to use. This commit adds the different variation to fix that.
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Common.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/system/core/Common.php b/system/core/Common.php index fadc0a0b1..f8ab7e800 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -569,7 +569,7 @@ if ( ! function_exists('set_status_header')) return; } - $server_protocol = (isset($_SERVER['SERVER_PROTOCOL']) && in_array($_SERVER['SERVER_PROTOCOL'], array('HTTP/1.0', 'HTTP/1.1', 'HTTP/2'), TRUE)) + $server_protocol = (isset($_SERVER['SERVER_PROTOCOL']) && in_array($_SERVER['SERVER_PROTOCOL'], array('HTTP/1.0', 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0'), TRUE)) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'; header($server_protocol.' '.$code.' '.$text, TRUE, $code); } |