Bug 80172 - [Chromium] KURL behaves differently
Summary: [Chromium] KURL behaves differently
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 76198
  Show dependency treegraph
 
Reported: 2012-03-02 10:38 PST by Takashi Toyoshima
Modified: 2013-04-15 06:26 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Takashi Toyoshima 2012-03-02 10:38:37 PST
WebSocket uses KURL to validate URL.
But, KURL in Chromium using googleurl behaves differently from Safari.

http://samples.msdn.microsoft.com/ietestcenter/#websockets

The white space (%20) is handled as is in Safari, and escaped like '%20' in Chrome.

[Safari]
> ws = new WebSocket('ws://foo bar/')
x Invalid url for WebSocket ws://foo bar
x |> DOMException

[Chrome]
> ws = new WebSocket('ws://foo bar/')
  |> WebSocket
> ws.url
  "ws://foo%20bar/"

We just verity the url as

m_url = KURL(KURL(), url);
if (!m_url.isValid()) {
  ...
Comment 1 Takashi Toyoshima 2012-03-08 11:19:12 PST
I chat about this issue with Brett.

>Brett,
Sorry, I said that I tried url containing space in path, but actually i tried space in host.

Anyway, this escape is intended in Chromium port.
So, if WebSocket requires additional error check, we should implement own checker.

I filed another bug to introduce WebSocket own URL validator.
https://bugs.webkit.org/show_bug.cgi?id=80616