/** * Executes this filter. * * @param sfFilterChain $filterChain The filter chain. */ public function execute($filterChain) { if (!\Altumo\Http\IncomingHttpRequest::isSecure()) { if (\sfConfig::get('app_require_ssl') === true) { header('Location: https://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']); exit; } } $filterChain->execute(); }
/** * Throws an exception if SSL is required for API requests. * * @throws Exception * @return void */ protected function assertSslApiRequest() { //require SSL, if applicable if (\sfConfig::get('app_api_require_ssl', true)) { if (!\Altumo\Http\IncomingHttpRequest::isSecure()) { throw new \Exception('HTTPS is required.'); } } }