Skip to content

Commit

Permalink
Reject ICE servers with an authority component or /
Browse files Browse the repository at this point in the history
Complete integration of URL parser from #2853
see also #2997 (comment)
This aligns with the constraints set in the respective RFC (and thus with the current WebRTC Rec)
  • Loading branch information
dontcallmedom committed Oct 30, 2024
1 parent e00c759 commit 1253b4d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion amendments.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"validate-ice-server-algo": [
{
"description": "Use the url spec to parse ice server urls",
"pr": [2853, 2996],
"pr": [2853, 2996, 2998],
"type": "correction",
"tests": [
"webrtc/RTCConfiguration-iceServers.html"
Expand Down
14 changes: 9 additions & 5 deletions webrtc.html
Original file line number Diff line number Diff line change
Expand Up @@ -3110,7 +3110,7 @@ <h4>
<ol id="validate-ice-server-algo" class="algorithm">
<li>
<p>Let <var>parsedURL</var> be the result of
<a data-cite="!url#concept-url-parser">parsing</a>
[=basic url parser|parsing=]
<var>url</var>.</p>
</li>
<li>
Expand All @@ -3121,9 +3121,10 @@ <h4>
<li><var>parsedURL</var>'s [=url/scheme=] is neither `"stun"`,
`"stuns"`, `"turn"`, nor `"turns"`</li>
<li><var>parsedURL</var> does not have an [=url/opaque path=]</li>
<li><var>parsedURL</var>'s' [=url/fragment=] is non-null</li>
<li><var>parsedURL</var>'s' [=url/scheme=] is `"stun"` or `"stuns"`,
and <var>parsedURL</var>'s' [=url/query=] is non-null</li>
<li><var>parsedURL</var>'s [=url/opaque path=] contains one or more `"/"` or `"@"`</li>
<li><var>parsedURL</var>'s [=url/fragment=] is non-null</li>
<li><var>parsedURL</var>'s [=url/scheme=] is `"stun"` or `"stuns"`,
and <var>parsedURL</var>'s [=url/query=] is non-null</li>
</ul>
</li>
<li>
Expand All @@ -3132,12 +3133,15 @@ <h4>
</li>
<li>
<p>Let <var>hostAndPortURL</var> be result of
<a data-cite="!url#concept-url-parser">parsing</a> the concatenation of
[=basic url parser|parsing=] the concatenation of
`"https://"` and <var>parsedURL</var>'s [=url/path=].</p>
</li>
<li>
<p>If <var>hostAndPortURL</var> is failure, then [=exception/throw=] a
"{{SyntaxError}}" {{DOMException}}.</p>
<p>If <var>hostAndPortURL</var>'s [=url/path=],
[=url/username=], or [=url/password=] is non-null, then
[=exception/throw=] a "{{SyntaxError}}" {{DOMException}}.</p>
<p class="note">For "stun" and "stuns" schemes, this validates
[[!RFC7064]] section 3.1.<br>
For "turn" and "turns" schemes, this and the steps below validate
Expand Down

0 comments on commit 1253b4d

Please sign in to comment.