From 6fdf0d6e67a3a5c9113afb2d64dc9fd3725f859d Mon Sep 17 00:00:00 2001 From: Achraf Almouloudi Date: Mon, 10 Feb 2020 00:00:33 +0000 Subject: 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. --- system/core/Common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- cgit v1.2.3-24-g4f1b