Existe uma função exatamente para isso, chamada shouldUrlBeSecure
localizada em app/code/core/Mage/Core/Model/Config.php
linha 1477
.
Aqui está a função completa:
/**
* Check whether given path should be secure according to configuration security requirements for URL
* "Secure" should not be confused with https protocol, it is about web/secure/*_url settings usage only
*
* @param string $url
* @return bool
*/
public function shouldUrlBeSecure($url)
{
if (!Mage::getStoreConfigFlag(Mage_Core_Model_Store::XML_PATH_SECURE_IN_FRONTEND)) {
return false;
}
if (!isset($this->_secureUrlCache[$url])) {
$this->_secureUrlCache[$url] = false;
$secureUrls = $this->getNode('frontend/secure_url');
foreach ($secureUrls->children() as $match) {
if (strpos($url, (string)$match) === 0) {
$this->_secureUrlCache[$url] = true;
break;
}
}
}
return $this->_secureUrlCache[$url];
}
Para ver quais URLs devem ser seguros, você pode adicionar um simples Mage::log($secureUrls)
dentro da if
instrução. É assim que minha entrada de log era:
2014-02-12T11:55:26+00:00 DEBUG (7): Mage_Core_Model_Config_Element Object
(
[install] => /install/wizard/checkSecureHost
[customer] => /customer/
[sales] => /sales/
[authorizenet_paygate] => /paygate/authorizenet_payment
[checkout_onepage] => /checkout/onepage
[checkout_multishipping] => /checkout/multishipping
[paypal_express] => /paypal/express
[paypal_standard] => /paypal/standard
[paypal_express_callbackshippingoptions] => paypal/express/callbackshippingoptions
[googlecheckout_redirect] => /googlecheckout/redirect/
[googlecheckout_beacon] => /googlecheckout/api/beacon/
[googlecheckout_api] => /googlecheckout/api/
[review_customer] => /review/customer/
[tag_customer] => /tag/customer/
[wishlist] => /wishlist/
[paypaluk_express] => /paypaluk/express
[rss_catalog_review] => /rss/catalog/review
[rss_order_new] => /rss/order/new
[rss_catalog_notifystock] => /rss/catalog/notifystock
[centinel] => /centinel/
[newsletter_manage] => /newsletter/manage/
[downloadable] => /downloadable/customer/
[downloadable_download] => /downloadable/download/
[ogone_api] => /ogone/api
[persistent_onepage_register] => /persistent/index/saveMethod
[checkout_cart] => /checkout/cart
[storecredit_info] => /storecredit/info/
[giftcard_customer] => /giftcard/customer/
[enterprise_pbridge_pbridge] => /enterprise_pbridge/pbridge/
[invitation] => /invitation/
)
Agora, para descobrir como Magento muda HTTP
para HTTPS
eu acho que você provavelmente tem mergulhar no Zend Framework no lib
interior lib/Zend/Http/*
porque contém arquivos de maior interesse. Bem, de qualquer maneira espero que isso tenha ajudado. Boa sorte!