Skip to content

Commit

Permalink
Restrict setting protocol to "file"
Browse files Browse the repository at this point in the history
As file URLs cannot have username/password/port we don’t want to allow
changing the scheme of a URL that contains one or more of those
components.

Fixes #259.
  • Loading branch information
annevk committed Mar 10, 2017
1 parent 5807b28 commit 3c41b2d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,9 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
<p>If <var>state override</var> is given, run these subsubsteps:

<ol>
<li><p>If <var>url</var> <a>includes credentials</a> or has a non-null <a for=url>port</a>,
and <var>buffer</var> is "<code>file</code>", then return.

<li><p>If <var>url</var>'s <a for=url>scheme</a> is a <a>special scheme</a> and
<var>buffer</var> is not, then return.

Expand Down

0 comments on commit 3c41b2d

Please sign in to comment.