           end = uri.length;
            }
          }
        } else if (uri.startsWith(&quot;http&quot;, start)) {
          scheme = &quot;http&quot;;
          &#47;&#47; HTTP URIs should not have an explicit port of 80.
          if (portStart &gt; start &amp;&amp;
              portStart + 3 == pathStart &amp;&amp;
              uri.startsWith(&quot;80&quot;, portStart + 1)) {
            if (start == 0 &amp;&amp; end == uri.length) {
              uri = uri.replaceRange(portStart, pathStart, &quot;&q