Skip to content

Commit

Permalink
Fix #77: always decode "%2e" in a URL's path
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Jan 14, 2016
1 parent 99a85f7 commit bee5ad8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 31 deletions.
9 changes: 6 additions & 3 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1817,9 +1817,12 @@ optionally with an <a>encoding</a>
<li><p>If <a>c</a> is "<code>%</code>" and <a>remaining</a> does
not start with two <a>ASCII hex digits</a>, <a>syntax violation</a>.

<li><p><a>utf-8 percent encode</a> <a>c</a> using the
<a>default encode set</a>, and append the result to
<var>buffer</var>.
<li><p>If <a>c</a> is "<code>%</code>" and <a>remaining</a>, <a>ASCII lowercased</a> starts
with "<code>2e</code>", append "<code>.</code>" to <var>buffer</var> and increase
<var>pointer</var> by two.

<li><p>Otherwise, <a>utf-8 percent encode</a> <a>c</a> using the <a>default encode set</a>,
and append the result to <var>buffer</var>.
</ol>
</ol>

Expand Down
35 changes: 7 additions & 28 deletions url.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<div class="head">
<p data-fill-with="logo"><a class="logo" href="https://whatwg.org/"> <img alt="WHATWG" height="100" src="https://resources.whatwg.org/logo-url.svg"> </a> </p>
<h1 class="p-name no-ref allcaps" id="title">URL</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated <time class="dt-updated" datetime="2015-11-26">26 November 2015</time></span></h2>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Living Standard — Last Updated <time class="dt-updated" datetime="2016-01-14">14 January 2016</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>Participate:
Expand Down Expand Up @@ -1328,7 +1328,11 @@ <h3 class="heading settled" data-level="4.2" id="url-parsing"><span class="secno
<p>If <a data-link-type="dfn" href="#c">c</a> is "<code>%</code>" and <a data-link-type="dfn" href="#remaining">remaining</a> does
not start with two <a data-link-type="dfn" href="#ascii-hex-digits">ASCII hex digits</a>, <a data-link-type="dfn" href="#syntax-violation">syntax violation</a>. </p>
<li>
<p><a data-link-type="dfn" href="#utf-8-percent-encode">utf-8 percent encode</a> <a data-link-type="dfn" href="#c">c</a> using the <a data-link-type="dfn" href="#default-encode-set">default encode set</a>, and append the result to <var>buffer</var>. </p>
<p>If <a data-link-type="dfn" href="#c">c</a> is "<code>%</code>" and <a data-link-type="dfn" href="#remaining">remaining</a>, <a data-link-type="dfn" href="#ascii-lowercase">ASCII lowercased</a> starts
with "<code>2e</code>", append "<code>.</code>" to <var>buffer</var> and increase <var>pointer</var> by two. </p>
<li>
<p>Otherwise, <a data-link-type="dfn" href="#utf-8-percent-encode">utf-8 percent encode</a> <a data-link-type="dfn" href="#c">c</a> using the <a data-link-type="dfn" href="#default-encode-set">default encode set</a>,
and append the result to <var>buffer</var>. </p>
</ol>
</ol>
<dt><dfn data-dfn-type="dfn" data-noexport="" id="non-relative-path-state">non-relative path state<a class="self-link" href="#non-relative-path-state"></a></dfn>
Expand Down Expand Up @@ -2103,7 +2107,6 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
<li><a href="#ascii-lowercase">ASCII lowercase</a><span>, in §1</span>
<li><a href="#ascii-string">ASCII string</a><span>, in §1</span>
<li><a href="#authority-state">authority state</a><span>, in §4.2</span>
<li><a href="#dom-url-url-url-base-base">base</a><span>, in §6</span>
<li><a href="#concept-base-url">base URL</a><span>, in §4</span>
<li><a href="#concept-basic-url-parser">basic URL parser</a><span>, in §4.2</span>
<li><a href="#c">c</a><span>, in §1.1</span>
Expand All @@ -2117,8 +2120,6 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
<ul>
<li><a href="#concept-domain">dfn for host</a><span>, in §3</span>
<li><a href="#syntax-host-domain">dfn for hostsyntax</a><span>, in §3.2</span>
<li><a href="#dom-url-domaintoascii-domain-domain">argument for URL/domainToASCII(domain)</a><span>, in §6</span>
<li><a href="#dom-url-domaintounicode-domain-domain">argument for URL/domainToUnicode(domain)</a><span>, in §6</span>
</ul>
<li><a href="#concept-domain-to-ascii">domain to ASCII</a><span>, in §3.1</span>
<li><a href="#dom-url-domaintoascii">domainToASCII(domain)</a><span>, in §6.2</span>
Expand Down Expand Up @@ -2161,7 +2162,6 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
<li><a href="#host-state">host state</a><span>, in §4.2</span>
<li><a href="#dom-url-href">href</a><span>, in §6.3</span>
<li><a href="#include-credentials">include credentials</a><span>, in §4</span>
<li><a href="#dom-urlsearchparams-urlsearchparams-init-init">init</a><span>, in §6.4</span>
<li>
IPv4 address
<ul>
Expand All @@ -2187,16 +2187,6 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
<li><a href="#is-special">is special</a><span>, in §4</span>
<li><a href="#concept-urlsearchparams-list">list</a><span>, in §6.4</span>
<li><a href="#local-scheme">local scheme</a><span>, in §4</span>
<li>
name
<ul>
<li><a href="#dom-urlsearchparams-append-name-value-name">argument for URLSearchParams/append(name, value)</a><span>, in §6.4</span>
<li><a href="#dom-urlsearchparams-delete-name-name">argument for URLSearchParams/delete(name)</a><span>, in §6.4</span>
<li><a href="#dom-urlsearchparams-get-name-name">argument for URLSearchParams/get(name)</a><span>, in §6.4</span>
<li><a href="#dom-urlsearchparams-getall-name-name">argument for URLSearchParams/getAll(name)</a><span>, in §6.4</span>
<li><a href="#dom-urlsearchparams-has-name-name">argument for URLSearchParams/has(name)</a><span>, in §6.4</span>
<li><a href="#dom-urlsearchparams-set-name-value-name">argument for URLSearchParams/set(name, value)</a><span>, in §6.4</span>
</ul>
<li><a href="#concept-urlsearchparams-new">new</a><span>, in §6.4</span>
<li><a href="#non-relative-flag">non-relative flag</a><span>, in §4</span>
<li><a href="#non-relative-path-state">non-relative path state</a><span>, in §4.2</span>
Expand Down Expand Up @@ -2289,12 +2279,7 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
<li><a href="#syntax-url">dfn for urlsyntax</a><span>, in §4.1</span>
<li><a href="#url">(interface)</a><span>, in §6</span>
</ul>
<li>
url
<ul>
<li><a href="#dom-url-url-url-base-url">argument for URL/URL(url, base)</a><span>, in §6</span>
<li><a href="#concept-url-url">dfn for URL</a><span>, in §6</span>
</ul>
<li><a href="#concept-url-url">url</a><span>, in §6</span>
<li><a href="#url-code-points">URL code points</a><span>, in §4.1</span>
<li><a href="#concept-urlencoded-byte-serializer">urlencoded byte serializer</a><span>, in §5.2</span>
<li><a href="#concept-urlencoded-parser">urlencoded parser</a><span>, in §5.1</span>
Expand All @@ -2318,12 +2303,6 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
</ul>
<li><a href="#utf-8-percent-encode">utf-8 percent encode</a><span>, in §1.2</span>
<li><a href="#valid-domain">valid domain</a><span>, in §3.2</span>
<li>
value
<ul>
<li><a href="#dom-urlsearchparams-append-name-value-value">argument for URLSearchParams/append(name, value)</a><span>, in §6.4</span>
<li><a href="#dom-urlsearchparams-set-name-value-value">argument for URLSearchParams/set(name, value)</a><span>, in §6.4</span>
</ul>
<li><a href="#windows-drive-letter">Windows drive letter</a><span>, in §1</span>
</ul>
<h3 class="no-num heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3>
Expand Down

0 comments on commit bee5ad8

Please sign in to comment.