Skip to content

Commit

Permalink
Enabling HTTP Strict Transport Security in response headers
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilMM89 authored Aug 31, 2023
1 parent 7ac766e commit d1fafa1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/main/java/ca/bc/gov/iamp/bcparis/WebSecurityConfig.java
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);
}
}

0 comments on commit d1fafa1

Please sign in to comment.