Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Change the http version from 1.0 to 1.1 in PHP
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arthurdarcet committed Sep 4, 2014
1 parent 717910d commit 722f971
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/php/Genghis/Response.php
Expand Up @@ -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]));
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';
header(sprintf('%s %s %s', $protocol, $this->status, self::$statusCodes[$this->status]));
foreach ($this->headers as $name => $val) {
header(sprintf('%s: %s', $name, $val));
}
Expand Down

0 comments on commit 722f971

Please sign in to comment.