File tree 4 files changed +6
-40
lines changed 4 files changed +6
-40
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 19
19
20
20
import lombok .RequiredArgsConstructor ;
21
21
import org .springframework .security .web .header .HeaderWriter ;
22
- import ru .mystamps .web .Url ;
23
22
import ru .mystamps .web .feature .collection .CollectionUrl ;
24
23
import ru .mystamps .web .feature .series .SeriesUrl ;
25
24
@@ -42,7 +41,8 @@ class ContentSecurityPolicyHeaderWriter implements HeaderWriter {
42
41
43
42
private static final String ADD_IMAGE_PAGE_PATTERN = "/series/(add|\\ d+|\\ d+/(ask|image))" ;
44
43
45
- private static final String H2_CONSOLE_PATTERN = Url .H2_CONSOLE_PAGE + '/' ;
44
+ // see also spring.h2.console.path in application-test.properties and SecurityConfig
45
+ private static final String H2_CONSOLE_PATTERN = "/console/" ;
46
46
47
47
// default policy prevents loading resources from any source
48
48
private static final String DEFAULT_SRC = "default-src 'none'" ;
Original file line number Diff line number Diff line change 41
41
import org .springframework .security .crypto .password .PasswordEncoder ;
42
42
import org .springframework .security .web .access .AccessDeniedHandler ;
43
43
import org .springframework .security .web .authentication .Http403ForbiddenEntryPoint ;
44
- import ru .mystamps .web .Url ;
45
44
import ru .mystamps .web .feature .account .AccountUrl ;
46
45
import ru .mystamps .web .feature .account .UserService ;
47
46
import ru .mystamps .web .feature .category .CategoryUrl ;
@@ -133,7 +132,9 @@ protected void configure(HttpSecurity http) throws Exception {
133
132
.and ()
134
133
.csrf ()
135
134
// Allow unsecured requests to H2 consoles.
136
- .ignoringAntMatchers (Url .H2_CONSOLE_PAGE + "/**" )
135
+ // See also spring.h2.console.path in application-test.properties and
136
+ // ContentSecurityPolicyHeaderWriter.H2_CONSOLE_PATTERN
137
+ .ignoringAntMatchers ("/console/**" )
137
138
.and ()
138
139
.rememberMe ()
139
140
// FIXME: GH #27
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ spring.datasource.driver-class-name: org.h2.Driver
7
7
spring.datasource.initialize : false
8
8
9
9
spring.h2.console.enabled : true
10
- # see also ru.mystamps.web.Url.H2_CONSOLE_PAGE constant
10
+ # see also SecurityConfig and ContentSecurityPolicyHeaderWriter.H2_CONSOLE_PATTERN
11
11
spring.h2.console.path : /console
12
12
security.basic.enabled : false
13
13
# required for using /console with CSP because we have many hashes as a workaround
You can’t perform that action at this time.
0 commit comments