yStart &lt; end &amp;&amp;
            (queryStart == pathStart + 2 &amp;&amp;
                uri.startsWith(&quot;..&quot;, pathStart)) ||
        (queryStart &gt; pathStart + 2 &amp;&amp;
            uri.startsWith(&quot;&#47;..&quot;, queryStart - 3))) {
      &#47;&#47; The path ends in a &quot;..&quot; segment. This should be normalized to &quot;..&#47;&quot;.
      &#47;&#47; We didn&#39;t detect this while scanning because a query or fragment was
      &#47;&#47; detected at the same time (which is 