Skip to content

Commit

Permalink
Merge pull request #264 from magento-ogre/PR_Branch
Browse files Browse the repository at this point in the history
[Ogre] Fixed Github #1212 Unable to open home page after successful installation
  • Loading branch information
monkeysee committed Apr 30, 2015
2 parents 1efdc59 + e39db1e commit ade3933
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public function aroundDispatch(

$response = $this->_responseFactory->create();
$response->setRedirect($redirectUrl, $redirectCode);
$response->setNoCacheHeaders();
return $response;
}
}
Expand Down
7 changes: 6 additions & 1 deletion app/code/Magento/Store/Model/Store.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,12 @@ public function isCurrentlySecure()
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);

if (!$secureBaseUrl) {
if (!$secureBaseUrl ||
!$this->_config->getValue(
self::XML_PATH_SECURE_IN_FRONTEND,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
)
) {
return false;
}

Expand Down
15 changes: 14 additions & 1 deletion app/code/Magento/Store/Test/Unit/Model/StoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,12 +546,15 @@ public function testDeleteCookie()
*
* @param bool $expected
* @param array $value
* @param bool $requestSecure
* @param bool $useSecureInFrontend
* @param string|null $secureBaseUrl
*/
public function testIsCurrentlySecure(
$expected,
$value,
$requestSecure = false,
$useSecureInFrontend = true,
$secureBaseUrl = 'https://example.com:443'
) {
/* @var ReinitableConfigInterface|PHPUnit_Framework_MockObject_MockObject $configMock */
Expand All @@ -565,6 +568,12 @@ public function testIsCurrentlySecure(
null,
$secureBaseUrl
],
[
Store::XML_PATH_SECURE_IN_FRONTEND,
ScopeInterface::SCOPE_STORE,
null,
$useSecureInFrontend
]
]));

$this->requestMock->expects($this->any())
Expand Down Expand Up @@ -594,8 +603,12 @@ public function isCurrentlySecureDataProvider()
return [
'secure request, no server setting' => [true, [], true],
'unsecure request, using registered port' => [true, 443],
'unsecure request, no secure base url registered' => [false, 443, false, null],
'unsecure request, no secure base url registered' => [false, 443, false, true, null],
'unsecure request, not using registered port' => [false, 80],
'unsecure request, using registered port, not using secure in frontend' => [false, 443, false, false],
'unsecure request, no secure base url registered, not using secure in frontend' =>
[false, 443, false, false, null],
'unsecure request, not using registered port, not using secure in frontend' => [false, 80, false, false],
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,8 @@ public function isCurrentlySecureDataProvider()
[true, ['HTTPS' => 'on']],
[true, ['SSL_OFFLOADED' => 'https']],
[true, ['HTTP_SSL_OFFLOADED' => 'https']],
[true, ['SERVER_PORT' => 80]],
[true, ['HTTPS' => 'on', 'SERVER_PORT' => 80]],
[false, ['SERVER_PORT' => 80]],
[false, []],
];
}
Expand Down

0 comments on commit ade3933

Please sign in to comment.