| Description: |
According to the websocket RFC, the sec-websocket-protocol header is optional for additional protocols on top of websocket.
The websocket::validate ($headers) proc does not set the "protocols" dict entry, if no sec-websocket-protocol header is present. But websocket::test assumes that the "protocols" entry is always present.
Line 492: set protos [dict get $res protocols]
It can be worked around if no sec-websocket-protocol is present, by changing that line 492 to:
set protos [expr { ([dict exists $res protocols]) ? [dict get $res protocols] : [list *] }]
to install a handler for all protocols. Is this a viable fix?
|