@@ -87,22 +87,21 @@ public void configure(WebSecurity web) throws Exception {
87
87
protected void configure (HttpSecurity http ) throws Exception {
88
88
boolean useSingleHost = !environment .acceptsProfiles ("prod" );
89
89
boolean useCdn = environment .getProperty ("app.use-cdn" , Boolean .class , Boolean .TRUE );
90
- boolean hasH2Console = environment .acceptsProfiles ("test" );
91
90
92
91
// @todo #226 Introduce app.use-public-hostname property
93
92
boolean usePublicHostname = environment .acceptsProfiles ("prod" );
94
93
String hostname = usePublicHostname ? SiteUrl .PUBLIC_URL : SiteUrl .SITE ;
95
94
96
- String h2ConsolePath = hasH2Console ? h2ConsoleProperties .getPath () : null ;
95
+ String h2ConsolePath = h2ConsoleProperties != null ? h2ConsoleProperties .getPath () : null ;
97
96
98
97
// Allow unsecured requests to H2 consoles if available.
99
98
// See also spring.h2.console.path in application-test.properties
100
99
String [] pathsToIgnore =
101
- hasH2Console ? new String []{h2ConsolePath + "/**" , SiteUrl .CSP_REPORTS_HANDLER }
102
- : new String []{SiteUrl .CSP_REPORTS_HANDLER };
100
+ h2ConsolePath != null ? new String []{h2ConsolePath + "/**" , SiteUrl .CSP_REPORTS_HANDLER }
101
+ : new String []{SiteUrl .CSP_REPORTS_HANDLER };
103
102
104
103
ContentSecurityPolicyHeaderWriter cspWriter =
105
- new ContentSecurityPolicyHeaderWriter (useCdn , useSingleHost , hasH2Console , hostname , h2ConsolePath );
104
+ new ContentSecurityPolicyHeaderWriter (useCdn , useSingleHost , hostname , h2ConsolePath );
106
105
107
106
http
108
107
.authorizeRequests ()
0 commit comments