fix: 把原生 WS 与 SockJS 分路径,避免混淆

This commit is contained in:
tim
2025-08-22 23:46:58 +08:00
parent 3a979277e4
commit 0a82f0036b
2 changed files with 25 additions and 10 deletions

View File

@@ -105,7 +105,7 @@ public class SecurityConfig {
.exceptionHandling(eh -> eh.accessDeniedHandler(customAccessDeniedHandler))
.authorizeHttpRequests(auth -> auth
.requestMatchers(HttpMethod.OPTIONS, "/**").permitAll()
.requestMatchers("/api/ws/**").permitAll()
.requestMatchers("/api/ws/**", "/api/sockjs/**").permitAll()
.requestMatchers(HttpMethod.POST, "/api/auth/**").permitAll()
.requestMatchers(HttpMethod.GET, "/api/posts/**").permitAll()
.requestMatchers(HttpMethod.GET, "/api/comments/**").permitAll()