Bug 146055

Summary: URL: trim before scheme checks
Product: WebKit Reporter: Anne van Kesteren <annevk>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ap, beidson, cdumez, darin, eoconnor, kling
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Anne van Kesteren 2015-06-17 05:03:00 PDT
The backslash replacement in https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/URL.cpp#L470 should happen after the C0 controls and space removal at https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/URL.cpp#L492 because otherwise e.g. " data:\" turns into "data:/" which does not seem desired.

(I was also wondering if we could limit the backslash replacement to only the special schemes: http/https/ftp/gopher/file/ws/wss?)
Comment 1 Alexey Proskuryakov 2015-06-18 09:14:13 PDT
Thank you, good catch!

> (I was also wondering if we could limit the backslash replacement to only the special schemes: http/https/ftp/gopher/file/ws/wss?)

Wait, so we perform backslash replacement for custom protocols? That seems crazy, hopefully no clients rely on that.
Comment 2 Darin Adler 2015-06-19 10:25:43 PDT
Yes, both these changes seem worthwhile.
Comment 3 Anne van Kesteren 2023-04-05 09:58:02 PDT
All this code changed due to the URL rewrite. And we match the standard except for a couple known cases.