You are here

function cdn_check_protocol in CDN 6.2

Same name and namespace in other branches
  1. 7.2 cdn.module \cdn_check_protocol()

Check if the current protocol is supported by the CDN.

Note: currently only checks HTTPS, in the future possibly also SPDY.

2 calls to cdn_check_protocol()
cdn_file_url_alter in ./cdn.module
Implementation of hook_file_url_alter().
_cdn_css_aggregate in ./cdn.basic.css.inc
Mostly based on drupal_get_css().

File

./cdn.module, line 707

Code

function cdn_check_protocol() {
  $https_support = variable_get(CDN_HTTPS_SUPPORT_VARIABLE, FALSE);

  // If the current page is being served via HTTPS, and the CDN does not
  // support HTTPS, then don't rewrite the file URL, because it would make the
  // visit insecure.
  if (cdn_request_is_https() && !$https_support) {
    return FALSE;
  }
  return TRUE;
}