[-] FO : Do not redirect on 301 when POST request

This commit is contained in:
Jerome Nadaud
2013-08-09 10:20:42 +02:00
parent 64698d1590
commit cbc7b9567a
+7 -10
View File
@@ -114,18 +114,15 @@ class FrontControllerCore extends Controller
$css_files = $this->css_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('Cache-Control: no-cache');
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
exit();
}
elseif (Configuration::get('PS_SSL_ENABLED') && Tools::usingSecureMode() && !($this->ssl))
{
header('HTTP/1.1 301 Moved Permanently');
header('Cache-Control: no-cache');
header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']);
if ($this->ssl)
header('Location: '.Tools::getShopDomainSsl(true).$_SERVER['REQUEST_URI']);
else
header('Location: '.Tools::getShopDomain(true).$_SERVER['REQUEST_URI']);
exit();
}
@@ -1140,4 +1137,4 @@ class FrontControllerCore extends Controller
'logo_url' => $logo
);
}
}
}