-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add test for URL parsing of ICE servers in RTCConfiguration #47959
base: master
Are you sure you want to change the base?
Add test for URL parsing of ICE servers in RTCConfiguration #47959
Conversation
see w3c/webrtc-pc#2853 and related discussions in w3c/webrtc-pc#2997 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be interesting to see the pass/fail on these.
I'm still hesitant about the idea of using the generic parser.
RFC 7065 (TURN URI) says that "developers MUST NOT use a generic hierarchical URI parser to parse a "turn" or "turns" URI".
@@ -301,4 +301,33 @@ | |||
}] })); | |||
}, `with empty urls should throw SyntaxError`); | |||
|
|||
// Inspired from https://github.com/web-platform-tests/wpt/blob/master/url/resources/urltestdata.json | |||
const validUrls = ['stun:example\t.\norg', 'stun:ex%61mple.net', 'stun:[2001::1]', 'stun:example(&!$)*+-.;_=~☺org', 'stun:example.net:', 'stun:example.net:0000000000000000', 'stun:example.net:65535', 'stun:example.net:\n', 'stun:GOO\u200b\u2060\ufeffgoo.com', '\u0000\u001b\u0004\u0012 stun:example.com\u001f \u000d ', 'stun:www.foo。bar.com', 'stun:Go.com', 'stun:你好你好', 'stun:faß.ExAmPlE', 'stun:%30%78%63%30%2e%30%32%35%30.01', 'stun:%30%78%63%30%2e%30%32%35%30.01%2e', 'stun:0Xc0.0250.01', 'stun:.', 'stun:ho\u0009st', "stun:!\"$&'()*+,-.;=_`{}~", "stun:\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u007F!\"$%&'()*+,-.;=_`{}~", "stun:h\to\ns\rt:9\t0\n0\r0", 'stun:1.2.3.4.', 'stun:192.168.257', '192.168.257.com', 'stun:256', 'stun:256.com', 'stun:999999999', 'stun:0xffffffff', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you format those blocks with one URL per line (s/,/,\n/) for easier reading and commenting?
Note that 192.168.257 is a perfectly valid IP address, but it means the same as 192.168.1.1 (I think).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reformatted (and indeed, it is in the list of valid addresses)
// Inspired from https://github.com/web-platform-tests/wpt/blob/master/url/resources/urltestdata.json | ||
const validUrls = ['stun:example\t.\norg', 'stun:ex%61mple.net', 'stun:[2001::1]', 'stun:example(&!$)*+-.;_=~☺org', 'stun:example.net:', 'stun:example.net:0000000000000000', 'stun:example.net:65535', 'stun:example.net:\n', 'stun:GOO\u200b\u2060\ufeffgoo.com', '\u0000\u001b\u0004\u0012 stun:example.com\u001f \u000d ', 'stun:www.foo。bar.com', 'stun:Go.com', 'stun:你好你好', 'stun:faß.ExAmPlE', 'stun:%30%78%63%30%2e%30%32%35%30.01', 'stun:%30%78%63%30%2e%30%32%35%30.01%2e', 'stun:0Xc0.0250.01', 'stun:.', 'stun:ho\u0009st', "stun:!\"$&'()*+,-.;=_`{}~", "stun:\u0001\u0002\u0003\u0004\u0005\u0006\u0007\u0008\u000B\u000C\u000E\u000F\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001A\u001B\u001C\u001D\u001E\u001F\u007F!\"$%&'()*+,-.;=_`{}~", "stun:h\to\ns\rt:9\t0\n0\r0", 'stun:1.2.3.4.', 'stun:192.168.257', '192.168.257.com', 'stun:256', 'stun:256.com', 'stun:999999999', 'stun:0xffffffff', | ||
// Spec say the following are valid, | ||
// but that sounds like a bug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RFC 7064 section 3.1 says that they are not valid (no hierarchical part in the ABNF following "host/port" - please disambiguate "spec" here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant the WebRTC API - clarified
test results can be previewed at https://wpt.fyi/results/webrtc/RTCConfiguration-iceServers.html?sha=c515f732fc261e22d64b2d49de2a4b6f5cdc6502 |
It's possible that we need to specify the steps as:
But that's for the webrtc-pc spec to disambiguate. |
I'll refrain from merging for now since I expect we will want to fix the remaining inconsistencies with RFC parsing |
see w3c/webrtc-pc#2853 and related discussions in w3c/webrtc-pc#2997 (comment)