Skip to content

Commit

Permalink
Issue #12881: Support Strict-Transport-Security header
Browse files Browse the repository at this point in the history
See http://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security for a
full description of what this header achieves.
  • Loading branch information
davidhicks committed Mar 25, 2011
1 parent 0cb72b7 commit 583cdbd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/http_api.php
Expand Up @@ -150,6 +150,9 @@ function http_security_headers() {
}
}
header( "X-Content-Security-Policy: allow 'self';$t_avatar_img_allow; frame-ancestors 'none'" );
if ( isset( $_SERVER['HTTPS'] ) && ( utf8_strtolower( $_SERVER['HTTPS'] ) != 'off' ) ) {
header( 'Strict-Transport-Security: max-age=7776000' );
}
}
}

Expand Down

0 comments on commit 583cdbd

Please sign in to comment.