You are here

function cdn_check_protocol in CDN 7.2

Same name and namespace in other branches
  1. 6.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
Implements hook_file_url_alter().
_cdn_aggregate_css in ./cdn.basic.css.inc
Near-identical to Changes: call _cdn_build_css_cache() instead of drupal_build_css_cache().

File

./cdn.module, line 878

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;
}