You are here

function hsts_update_7100 in HTTP Strict Transport Security 7

Implements hook_update_N().

Only set HSTS headers on HTTPS connections.

File

./hsts.install, line 41
Install file for hsts.

Code

function hsts_update_7100(&$sandbox) {
  global $is_https;
  if (!$is_https) {
    drupal_set_message(t('HSTS was unable to detect if your site is running over HTTPS. Please check the HSTS configuration.'), 'warning');
  }

  // Safe default is to restrict to HTTPS only.
  variable_set('hsts_https_only', TRUE);
}