 <p>HTML entities like <code>&amp;amp;</code> are not a part of URI specification. As far as <a href="https://tools.ietf.org/html/rfc3986" rel="nofollow">RFC 3986</a> is concerned, <code>&amp;</code> is a sub-delimiting character, therefore if a server receives a query string like this:</p> <pre><code>foo=1&amp;amp;bar=2 </code></pre> <p>and parses it to the following key-value pairs:</p> <pre><code>'foo' =&gt; '1', 'amp;bar' =&gt; '2' </code></pre> <p>it is behaving correctly.</p> <p>To make things even more interesting, <code>;</code> is a reserved sub-delimiter, too, but: </p> <blockquote> <p>if a reserved character is found in a URI component and no delimiting role is known for that character, then it must be interpreted as representing the data octet corresponding to that character's encoding in US-ASCII.</p> </blockquote>