I have the following Spring Security (5.6.1) configuration with Spring Boot (2.6.3):
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().antMatchers("/index.html").permitAll()
.antMatchers("/overview.html").denyAll();
}
I also have some error pages located in /src/main/resources/public/error/
- 403.html
- 404.html
- 4xx.html
- 5xx.html
When I send a request to /overview.html
I get a 403 error and the content of the 403.html
. So far so good.
When I add an anyRequest().denyAll()
, I get a 403 error but the response body is empty.
Can anybody explain what's happening?