diff options
Diffstat (limited to 'src/main/java/com/juick/config/WebConfig.java')
-rw-r--r-- | src/main/java/com/juick/config/WebConfig.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/juick/config/WebConfig.java b/src/main/java/com/juick/config/WebConfig.java index fcd9a46b..59f9a99c 100644 --- a/src/main/java/com/juick/config/WebConfig.java +++ b/src/main/java/com/juick/config/WebConfig.java @@ -45,6 +45,8 @@ import org.springframework.core.io.Resource; import org.springframework.http.CacheControl; import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.security.web.firewall.HttpStatusRequestRejectedHandler; +import org.springframework.security.web.firewall.RequestRejectedHandler; import org.springframework.web.servlet.ViewResolver; import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; @@ -204,4 +206,8 @@ public class WebConfig implements WebMvcConfigurer { public User archiveUser() { return userService.getUserByName(archiveUsername); } + @Bean + public RequestRejectedHandler requestRejectedHandler() { + return new HttpStatusRequestRejectedHandler(); + } } |