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

This commit is contained in:
tim
2025-08-22 23:51:42 +08:00
parent 0a82f0036b
commit 88127fcf34

View File

@@ -174,7 +174,8 @@ public class SecurityConfig {
response.getWriter().write("{\"error\": \"Invalid or expired token\"}");
return;
}
} else if (!uri.startsWith("/api/auth") && !publicGet && !uri.startsWith("/api/ws")) {
} else if (!uri.startsWith("/api/auth") && !publicGet
&& !uri.startsWith("/api/ws") && !uri.startsWith("/api/sockjs") {
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
response.setContentType("application/json");
response.getWriter().write("{\"error\": \"Missing token\"}");