unshift(@_, '-cookie' => $self->{Bugzilla_cookie_list});
}
+ # Add Strict-Transport-Security (STS) header if this response
+ # is over SSL and ssl_redirect is enabled.
+ if ($self->https && Bugzilla->params->{'ssl_redirect'}) {
+ unshift(@_, '-strict-transport-security' => 'max-age=' . MAX_STS_AGE);
+ }
+
return $self->SUPER::header(@_) || "";
}
MAX_LOGINCOOKIE_AGE
MAX_LOGIN_ATTEMPTS
LOGIN_LOCKOUT_INTERVAL
+ MAX_STS_AGE
SAFE_PROTOCOLS
LEGAL_CONTENT_TYPES
# account is locked.
use constant LOGIN_LOCKOUT_INTERVAL => 30;
+# The maximum number of seconds the Strict-Transport-Security header
+# will remain valid. Default is one week.
+use constant MAX_STS_AGE => 604800;
+
# Protocols which are considered as safe.
use constant SAFE_PROTOCOLS => ('afs', 'cid', 'ftp', 'gopher', 'http', 'https',
'irc', 'mid', 'news', 'nntp', 'prospero', 'telnet',