Bug 80172

Summary: [Chromium] KURL behaves differently
Product: WebKit Reporter: Takashi Toyoshima <toyoshim>
Component: WebKit Misc.Assignee: Nobody <webkit-unassigned>
Severity: Normal CC: ap, bashi, brettw, ian, schenney, yutak
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 76198    

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.


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

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

> ws = new WebSocket('ws://foo bar/')
  |> WebSocket
> ws.url

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.

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.