Bug 164508 - WebRTC: URL class can't parse ICE helper server urls properly
Summary: WebRTC: URL class can't parse ICE helper server urls properly
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Blocks: 143211
  Show dependency treegraph
Reported: 2016-11-08 00:37 PST by Adam Bergkvist
Modified: 2017-08-29 23:57 PDT (History)
7 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Adam Bergkvist 2016-11-08 00:37:33 PST
WebKit's URL class can only parse the scheme part of a ICE helper server url. These urls have a host and a port but are not hierarchical [1].

The OpenWebRTC WebRTC backend (MediaEndpointOwr) currently extracts the original url string from the URL object and parses it again.

[1] https://tools.ietf.org/html/rfc7064#section-3.1
Comment 1 Alex Christensen 2017-02-02 00:17:40 PST
I just noticed this after having rewritten the URLParser.  Could you give an example of such a URL?
Comment 2 Adam Bergkvist 2017-02-09 04:38:59 PST
The URI schemas are defined here [1][2].

A simple example is:

[1] https://tools.ietf.org/html/rfc7064#section-3
[2] https://tools.ietf.org/html/rfc7065#section-3
Comment 3 Alex Christensen 2017-02-09 10:28:40 PST
try {
    var u = new URL("stun:stun1.example.net");
    alert("scheme " + u.scheme);
    alert("host " + u.host);
    alert("pathname " + u.pathname);
} catch (e) { alert("threw"); }

This behaves the same in Chrome, Firefox, and Safari.  Are you expecting the host to be stun1.example.net?  What problems are actually caused by this?  It's possible we will need to revise either the URL grammar or the grammars defined in those RFCs.  We definitely need to keep the URL object's behavior for schemes like mailto, though.
Comment 4 Adam Bergkvist 2017-02-10 00:11:41 PST
I was a bit unclear in the bug title, but I was referring to the cpp class URL.
Comment 5 Radar WebKit Bug Importer 2017-08-29 09:52:01 PDT
Comment 6 Jon Lee 2017-08-29 15:44:38 PDT
Is this still a valid bug?
Comment 7 Adam Bergkvist 2017-08-29 23:57:21 PDT
I don't have a build available to test at the moment.

For example in [1], the ICE helper server urls are parsed to WebKit URLs. Host and port are not parsed correctly.

[1] https://github.com/WebKit/webkit/blob/master/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp#L305