Skip to content
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

Restrict setting protocol to "file" #269

Merged
merged 2 commits into from
Mar 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1495,6 +1495,12 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti

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

<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 "<code>file</code>" and its
<a for=url>host</a> is an <a>empty host</a> or null, then return.
Copy link
Member

@rmisev rmisev Mar 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the last item must be:

4. If url's host is an empty host or null, and buffer is a non-"file" special scheme, then return.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's only "file" that can come here and hit this. Other non-special schemes cannot be set to special schemes due to the earlier steps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I could remove the check for scheme being "file" though, since only file can have an empty/null host.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that would be bad, since that would also block non-special URLs without host from changing schemes. Oops.

</ol>

<li><p>Set <var>url</var>'s <a for=url>scheme</a> to <var>buffer</var>.
Expand Down