From c673f41bfd5a256d67a6e59ae31294d039310c60 Mon Sep 17 00:00:00 2001 From: Arthur Darcet Date: Thu, 4 Sep 2014 11:59:03 +0200 Subject: [PATCH] Change the http version from 1.0 to 1.1 in PHP Without this, on one of my setup, upgrading from Apache 2.2 to Apache 2.4 would make the request for the JS asset hang. --- src/php/Genghis/Response.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/php/Genghis/Response.php b/src/php/Genghis/Response.php index 381b035d..bc82fe2b 100644 --- a/src/php/Genghis/Response.php +++ b/src/php/Genghis/Response.php @@ -50,7 +50,8 @@ public static function getStatusText($status) protected function renderHeaders() { - header(sprintf('HTTP/1.0 %s %s', $this->status, self::$statusCodes[$this->status])); + $version = ($_SERVER['SERVER_PROTOCOL'] === 'HTTP/1.0') ? '1.0' : '1.1'; + header(sprintf('HTTP/%s %s %s', $version, $this->status, self::$statusCodes[$this->status])); foreach ($this->headers as $name => $val) { header(sprintf('%s: %s', $name, $val)); }