Skip to content

Commit

Permalink
Add default on-ping for websocket listener maps
Browse files Browse the repository at this point in the history
  • Loading branch information
weavejester committed Nov 5, 2023
1 parent cefb95e commit b2e8966
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ring-core/src/ring/websocket.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
(when-let [kv (find m :on-close)] ((val kv) socket code reason)))
p/PingListener
(on-ping [m socket data]
(when-let [kv (find m :on-ping)] ((val kv) socket data))))
(if-let [kv (find m :on-ping)]
((val kv) socket data)
(p/-pong socket data))))

(defn open?
"Returns true if the Socket is open, false otherwise."
Expand Down

0 comments on commit b2e8966

Please sign in to comment.