1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 19:37:03 +00:00

Merge pull request #925 from mcsakoff/websocket

Handle non-WS connections in WS handler with no panic

Former-commit-id: fcfdea392d93668f66a4af7a4d93ea9fd7d7c6ef
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-03-10 19:52:41 +02:00
committed by GitHub

View File

@@ -147,6 +147,9 @@ func New(cfg Config) *Server {
func (s *Server) Handler() context.Handler {
return func(ctx context.Context) {
c := s.Upgrade(ctx)
if c.Err() != nil {
return
}
// NOTE TO ME: fire these first BEFORE startReader and startPinger
// in order to set the events and any messages to send
// the startPinger will send the OK to the client and only