websocket: allow internal originless dial (#710)

This commit is contained in:
Seungwon Lee
2026-10-01 01:29:55 +09:00
committed by GitHub
parent 1725bfa50b
commit bdd0428a60
2 changed files with 44 additions and 1 deletions
+2 -1
View File
@@ -55,7 +55,8 @@ func New(WebSocketManager types.WebSocketManager, ApiManager types.ApiManager, c
router.Route("/api", ApiManager.Route)
router.Get("/api/ws", WebSocketManager.Upgrade(func(r *http.Request) bool {
return config.AllowOrigin(r.Header.Get("Origin"))
origin := r.Header.Get("Origin")
return origin == "" || config.AllowOrigin(origin)
}))
batch := batchHandler{