[Webkit-unassigned] [Bug 82714] WebSockets: The handshake should check for US-ASCII data instead of UTF-8.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 8 07:19:50 PST 2013


--- Comment #12 from Lamarque V. Souza <Lamarque.Souza at basyskom.com>  2013-03-08 07:22:14 PST ---
(In reply to comment #11)
> (In reply to comment #10)
> > http/tests/websocket/tests/hybi/handshake-fail-by-prepended-null.html sends utf-8 string during handshake phase of its test, that is why ch-linux and mac-wk2 buildbots are red now. I do not know exactly how to deal with this issue since handshake-fail-by-prepended-null.html should not be using utf-8 according to the HTML RFC.
> I can't see any non-ASCII UTF-8 char in handshake-fail-by-prepended-null_wsh.py, maybe the expectation doesn't match because of the '\0'?

The line below in handshake-fail-by-prepended-null_wsh.py creates UTF-8 string, whose first byte is 0xff (or -127). Because of that the unit test I added to my patch triggers an error and the error string printed in handshake-fail-by-prepended-null-expected.txt changes from "failed: Status line contains embedded null" to "Status line contains invalid ASCII sequence".

frame = stream.create_text_frame('\0Frame-contains-thirty-two-bytes')

> This tests an handshake failure and it should still fail with you patch, so you might just have to adjust the test or the expectation to fit the new behavior.

Yes, it does fail with my patch. The problem is that my unit test is "shadowing" handshake-fail-by-prepended-null. My unit test tests character values below zero and handshake-fail-by-prepended-null tests characters equal to zero. However, "\0" in UTF-8 and little endian starts with 0xff (-127), not zero. Just updating handshake-fail-by-prepended-null-expected.txt is not correct. What I need is changing handshake-fail-by-prepended-null_wsh.py to create US-ASCII string instead of UTF-8.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list