If host provided to WebSocket constructor does'n have tralling slash, for example "ws://domain:port" or "ws://domain", WebSocket send GET request without Request-URI.
var ws = new WebSocket("ws://domain")
Confirmed it on Safari nightly build.
(no problem with Chromium, though)
Created attachment 46648 [details]
Comment on attachment 46648 [details]
Code changes look good, but I think I'll ask to rework the test. It has absolutely no reason to be script-tests-based - it doesn't have even a single shouldBe anywhere! A bigger issue is that test output doesn't really mention pass/fail criteria, and that it relies on assertions that may be gone at the same time the bug is reintroduced.
A more reliable way to test this would be for the server to report invalid requests in some manner (possibly by setting a state that can be retrieved later, or maybe by intercepting these and forwarding to a specific handler whose response we could check).
Created attachment 46989 [details]
Comment on attachment 46989 [details]
> + print STDERR "args: @args\n";
Did you mean to leave this in?
Committed r53592: <http://trac.webkit.org/changeset/53592>