Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/zendframework/zendframework#6896-ibmi-https-flag…
Browse files Browse the repository at this point in the history
…s-in-environment-request' into develop

Close zendframework/zendframework#6896
Forward port zendframework/zendframework#6896
  • Loading branch information
Ocramius committed Dec 16, 2014
4 parents 21406ca + c7ed528 + 4f4e25c + 114d8ac commit 2746aff
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/PhpEnvironment/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public function setServer(ParametersInterface $server)
$uri = new HttpUri();

// URI scheme
if ((!empty($this->serverParams['HTTPS']) && $this->serverParams['HTTPS'] !== 'off')
if ((!empty($this->serverParams['HTTPS']) && strtolower($this->serverParams['HTTPS']) !== 'off')
|| (!empty($this->serverParams['HTTP_X_FORWARDED_PROTO']) && $this->serverParams['HTTP_X_FORWARDED_PROTO'] == 'https')
) {
$scheme = 'https';
Expand Down
12 changes: 12 additions & 0 deletions test/PhpEnvironment/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,4 +772,16 @@ public function testAllowCustomMethodsFlagCanBeSetWithConstructor()

$request = new Request(false);
}

/**
* @group 6896
*/
public function testHandlesUppercaseHttpsFlags()
{
$_SERVER['HTTPS'] = 'OFF';

$request = new Request();

$this->assertSame('http', $request->getUri()->getScheme());
}
}

0 comments on commit 2746aff

Please sign in to comment.