[-] FO : Do not redirect on 301 when POST request
This commit is contained in:
1 parent
e923455f6d
commit
9ccd9b7cad
1 file changed
+6
-9
@@ -114,18 +114,15 @@ class FrontControllerCore extends Controller
|
|||||||
$css_files = $this->css_files;
|
$css_files = $this->css_files;
|
||||||
$js_files = $this->js_files;
|
$js_files = $this->js_files;
|
||||||
|
|
||||||
if ($this->ssl && !Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED'))
|
// If we call a SSL controller without SSL or a non SSL controller with SSL, we redirect with the right protocol
|
||||||
|
if (Configuration::get('PS_SSL_ENABLED') && ($_SERVER['REQUEST_METHOD'] != 'POST') && $this->ssl != Tools::usingSecureMode())
|
||||||
{
|
{
|
||||||
header('HTTP/1.1 301 Moved Permanently');
|
header('HTTP/1.1 301 Moved Permanently');
|
||||||
header('Cache-Control: no-cache');
|
header('Cache-Control: no-cache');
|
||||||
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
|
if ($this->ssl)
|
||||||
exit();
|
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
|
||||||
}
|
else
|
||||||
elseif (Configuration::get('PS_SSL_ENABLED') && Tools::usingSecureMode() && !($this->ssl))
|
header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']);
|
||||||
{
|
|
||||||
header('HTTP/1.1 301 Moved Permanently');
|
|
||||||
header('Cache-Control: no-cache');
|
|
||||||
header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']);
|
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user