-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enabling HTTP Strict Transport Security in response headers
- Loading branch information
1 parent
7ac766e
commit d1fafa1
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/main/java/ca/bc/gov/iamp/bcparis/WebSecurityConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package ca.bc.gov.iamp.bcparis; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.security.config.annotation.web.builders.HttpSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | ||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; | ||
|
||
@EnableWebSecurity | ||
public class WebSecurityConfig extends WebSecurityConfigurerAdapter { | ||
|
||
@Override | ||
protected void configure(HttpSecurity http) throws Exception { | ||
http | ||
.headers() | ||
.httpStrictTransportSecurity() | ||
.includeSubdomains(true) | ||
.maxAgeSeconds(31536000); | ||
} | ||
} |