Skip to content

Commit

Permalink
Remove FTP support
Browse files Browse the repository at this point in the history
Any fetching of ftp: URLs will now result in a network error.

This also removes network scheme in favor of using HTTP(S) scheme exclusively.

Closes #1009.
  • Loading branch information
annevk committed Feb 10, 2021
1 parent c8c2b62 commit b546df2
Showing 1 changed file with 5 additions and 41 deletions.
46 changes: 5 additions & 41 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,11 @@ number.
<p>An <dfn export id=http-scheme>HTTP(S) scheme</dfn> is a <a for=url>scheme</a> that is
"<code>http</code>" or "<code>https</code>".

<p>A <dfn export>network scheme</dfn> is a <a for=url>scheme</a> that is "<code>ftp</code>" or an
<a>HTTP(S) scheme</a>.

<p>A <dfn export>fetch scheme</dfn> is a <a for=url>scheme</a> that is "<code>about</code>",
"<code>blob</code>", "<code>data</code>", "<code>file</code>", or a <a>network scheme</a>.
"<code>blob</code>", "<code>data</code>", "<code>file</code>", or an <a>HTTP(S) scheme</a>.

<p class="note no-backref"><a>HTTP(S) scheme</a>, <a>network scheme</a>, and <a>fetch scheme</a> are
also used by <cite>HTML</cite>. [[HTML]]
<p class="note no-backref"><a>HTTP(S) scheme</a> and <a>fetch scheme</a> are also used by
<cite>HTML</cite>. [[HTML]]

<hr>

Expand Down Expand Up @@ -2227,11 +2224,8 @@ run these steps:
<li><p>Let <var>port</var> be <var>url</var>'s
<a for=url>port</a>.

<li><p>If <var>scheme</var> is "<code>ftp</code>" and <var>port</var> is 20 or 21, then
return <b>allowed</b>.

<li><p>Otherwise, if <var>scheme</var> is a <a>network scheme</a> and
<var>port</var> is a <a>bad port</a>, then return <b>blocked</b>.
<li><p>If <var>scheme</var> is an <a>HTTP(S) scheme</a> and <var>port</var> is a <a>bad port</a>,
then return <b>blocked</b>.

<li><p>Return <b>allowed</b>.
</ol>
Expand Down Expand Up @@ -3398,14 +3392,6 @@ optionally with a <i>recursive flag</i>, run these steps:
<a for=request>referrer</a> to "<code>no-referrer</code>" or
have it expose less sensitive information.

<li>
<p>If <var>request</var>'s <a for=request>current URL</a>'s <a for=url>scheme</a> is
"<code>ftp</code>", <var>request</var>'s <a for=request>client</a>'s
<a for=environment>creation URL</a>'s <a for=url>scheme</a> is not "<code>ftp</code>", and
<var>request</var>'s <a for=request>reserved client</a> is either null or an
<a for=/>environment</a> whose <a for=environment>target browsing context</a> is a
<a>nested browsing context</a>, then set <var>response</var> to a <a>network error</a>.

<li>
<p>Set <var>request</var>'s <a for=request>current URL</a>'s <a for=url>scheme</a> to
"<code>https</code>" if all of the following conditions are true:
Expand Down Expand Up @@ -3800,28 +3786,6 @@ optionally with a <i>recursive flag</i>, run these steps:

<p>When in doubt, return a <a>network error</a>.

<dt>"<code>ftp</code>"
<dd>
<p>For now, unfortunate as it is, <code>ftp</code> <a for=/>URLs</a> are mostly left as an
exercise for the reader.

<ol>
<li><p>Let <var>body</var> be the result of the user agent obtaining content from
<var>request</var>'s <a for=request>current URL</a> from the network via FTP. [[!RFC959]]

<li><p>Let </var>mime</var> be `<code>application/octet-stream</code>`.

<li><p>If <var>body</var> is the result of the user agent generating a directory listing page for
the result of FTP's LIST command, then set |mime| to `<code>text/ftp-dir</code>`.

<li><p>Return a <a for=/>response</a> whose <a for="response">status message</a> is
`<code>OK</code>`, <a for=response>header list</a> consists of a single <a for=/>header</a>
whose <a for=header>name</a> is `<code>Content-Type</code>` and whose <a for=header>value</a> is
<var>mime</var>, and <a for=response>body</a> is <var>body</var>.
</ol>

<p>When in doubt, return a <a>network error</a>.

<dt><a>HTTP(S) scheme</a>
<dd>
<p>Return the result of performing an <a>HTTP fetch</a>
Expand Down

0 comments on commit b546df2

Please sign in to comment.