This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 12913 - Close() should throw the same exception as send() for unpaired surrogates
Summary: Close() should throw the same exception as send() for unpaired surrogates
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: WebSocket API (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: public-webapps-bugzilla
URL: http://dev.w3.org/html5/websockets/#d...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-08 17:21 UTC by Adrian Bateman [MSFT]
Modified: 2011-06-21 23:01 UTC (History)
3 users (show)

See Also:


Attachments

Description Adrian Bateman [MSFT] 2011-06-08 17:21:15 UTC
In the send() method, the spec [1] says: "If the data argument has any unpaired surrogates, then raise an SYNTAX_ERR exception."

This should also apply to the close() method for the reason string [2].

[1] http://dev.w3.org/html5/websockets/#dom-websocket-send
[2] http://dev.w3.org/html5/websockets/#dom-websocket-close
Comment 1 Ian 'Hixie' Hickson 2011-06-21 22:57:49 UTC
Done.
Comment 2 contributor 2011-06-21 23:01:26 UTC
Checked in as WHATWG revision r6270.
Check-in comment: Unpaired surrogates should throw an exception in close, like in send(), so we don't ask the protocol to send invalid utf-8
http://html5.org/tools/web-apps-tracker?from=6269&to=6270