[asterisk-dev] [Code Review] 2828: ARI: Fix WebSocket response when subprotocol isn't specified

opticron reviewboard at asterisk.org
Thu Sep 12 09:06:34 CDT 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2828/#review9669
-----------------------------------------------------------

Ship it!


Ship It!

- opticron


On Sept. 6, 2013, 3:39 p.m., David Lee wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2828/
> -----------------------------------------------------------
> 
> (Updated Sept. 6, 2013, 3:39 p.m.)
> 
> 
> Review request for Asterisk Developers and Joshua Colp.
> 
> 
> Bugs: ASTERISK-22441
>     https://issues.asterisk.org/jira/browse/ASTERISK-22441
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> When I moved the ARI WebSocket from /ws to /ari/events, I added code to
> allow a WebSocket to connect without specifying the subprotocol if
> there's only one subprotocol handler registered for the WebSocket.
> 
> Naively, I coded it to always respond with the subprotocol in use.
> Unfortunately, according to RFC 6455, if the server's response includes
> a subprotocol header field that "indicates the use of a subprotocol that
> was not present in the client's handshake [...], the client MUST _Fail
> the WebSocket Connection_.", emphasis theirs.
> 
> This patch correctly omits the Sec-WebSocket-Protocol if one is not
> specified by the client.
> 
> 
> Diffs
> -----
> 
>   /branches/12/res/res_http_websocket.c 398509 
> 
> Diff: https://reviewboard.asterisk.org/r/2828/diff/
> 
> 
> Testing
> -------
> 
> Used wscat and tshark to verify that the header is only present when
> needed.
> 
> Connected using Autobahn.py, which is what showed the problem in the
> first place.
> 
> 
> Thanks,
> 
> David Lee
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130912/536551f8/attachment-0001.htm>


More information about the asterisk-dev mailing list