Bug 33689 - WebSocket: Missing Request-URI, when no tralling slash in host
Summary: WebSocket: Missing Request-URI, when no tralling slash in host
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Macintosh Intel OS X 10.6
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-14 14:20 PST by y8
Modified: 2010-01-20 18:41 PST (History)
2 users (show)

See Also:


Attachments
Patch (4.19 KB, patch)
2010-01-15 00:28 PST, Fumitoshi Ukai
no flags Details | Formatted Diff | Diff
Patch (14.63 KB, patch)
2010-01-20 01:14 PST, Fumitoshi Ukai
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description y8 2010-01-14 14:20:14 PST
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") 

Produces: 

GET HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Host: localhost
Origin: http://localhost
Comment 1 Fumitoshi Ukai 2010-01-14 19:00:17 PST
Confirmed it on Safari nightly build.
(no problem with Chromium, though)
Comment 2 Fumitoshi Ukai 2010-01-15 00:28:24 PST
Created attachment 46648 [details]
Patch
Comment 3 Alexey Proskuryakov 2010-01-15 08:47:22 PST
Comment on attachment 46648 [details]
Patch

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).
Comment 4 Fumitoshi Ukai 2010-01-20 01:14:59 PST
Created attachment 46989 [details]
Patch
Comment 5 Alexey Proskuryakov 2010-01-20 08:36:59 PST
Comment on attachment 46989 [details]
Patch

> +    print STDERR "args: @args\n";

Did you mean to leave this in?

r=me
Comment 6 Fumitoshi Ukai 2010-01-20 18:41:36 PST
Committed r53592: <http://trac.webkit.org/changeset/53592>