fix: WebsocketListener nil panic and OIDC auth data race (#5204)

- pkg/util/net/websocket.go: store ln parameter in struct to prevent
  nil pointer panic when Addr() is called
- pkg/auth/oidc.go: replace unsynchronized []string with map + RWMutex
  for subjectsFromLogin to fix data race across concurrent connections
This commit is contained in:
fatedier
2026-03-06 16:51:52 +08:00
committed by GitHub
parent 8f633fe363
commit cb459b02b6
2 changed files with 13 additions and 8 deletions

View File

@@ -26,6 +26,7 @@ type WebsocketListener struct {
// ln: tcp listener for websocket connections
func NewWebsocketListener(ln net.Listener) (wl *WebsocketListener) {
wl = &WebsocketListener{
ln: ln,
acceptCh: make(chan net.Conn),
}