Skip to content

Commit

Permalink
Rolling back previous changes to the HTTP Protocol version and simply…
Browse files Browse the repository at this point in the history
… setting the response version to the request version.
  • Loading branch information
lonnieezell committed Mar 11, 2016
1 parent e4cdd26 commit 0333a63
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 23 deletions.
11 changes: 0 additions & 11 deletions application/Config/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ class App extends BaseConfig
*/
public $uriProtocol = 'REQUEST_URI';

/*
|--------------------------------------------------------------------------
| HTTP PROTOCOL
|--------------------------------------------------------------------------
|
| This is the highest value of the HTTP protocol that your application
| supports. Currently, most applications will be running under 1.1, but
| support for 2 is quickly growing.
*/
public $HTTPProtocolVersion = '1.1';

/*
|--------------------------------------------------------------------------
| URI PROTOCOL
Expand Down
2 changes: 2 additions & 0 deletions system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@
? Services::clirequest($config)
: Services::request($config);
$request->setProtocolVersion($_SERVER['SERVER_PROTOCOL']);

$response = Services::response($config);
$response->setProtocolVersion($request->getProtocolVersion());

// Assume success until proven otherwise.
$response->setStatusCode(200);
Expand Down
2 changes: 0 additions & 2 deletions system/HTTP/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ public function __construct(App $config)
$this->CSP = new ContentSecurityPolicy(new ContentSecurityPolicy());
$this->CSPEnabled = true;
}

$this->setProtocolVersion($config->HTTPProtocolVersion);
}

//--------------------------------------------------------------------
Expand Down
10 changes: 0 additions & 10 deletions tests/HTTP/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,4 @@ public function testRedirectSetsCode()

//--------------------------------------------------------------------

public function testResponseHasDefaultProtocolVersionSet()
{
$config = new \Config\App();
$response = new Response($config);

$this->assertNotEmpty($response->getProtocolVersion());
$this->assertEquals($config->HTTPProtocolVersion, $response->getProtocolVersion());
}

//---------------------------------------------
}

0 comments on commit 0333a63

Please sign in to comment.