Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>By default, the <code>Uri</code> class will not allow an escaped <code>/</code> character (<code>%2f</code>) in a URI (even though this appears to be legal in my reading of <a href="http://tools.ietf.org/html/rfc3986" rel="nofollow noreferrer">RFC 3986</a>).</p> <pre><code>Uri uri = new Uri("http://example.com/%2F"); Console.WriteLine(uri.AbsoluteUri); // prints: http://example.com// </code></pre> <p>(Note: <a href="https://faithlife.codes/blog/2010/08/uritostring_must_die/" rel="nofollow noreferrer">don't use Uri.ToString</a> to print URIs.)</p> <p>According to the <a href="https://connect.microsoft.com/VisualStudio/feedback/details/511010/erroneous-uri-parsing-for-encoded-reserved-characters-according-to-rfc-3986" rel="nofollow noreferrer">bug report for this issue</a> on Microsoft Connect, this behaviour is by design, but you can work around it by adding the following to your app.config or web.config file:</p> <pre><code>&lt;uri&gt; &lt;schemeSettings&gt; &lt;add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes" /&gt; &lt;/schemeSettings&gt; &lt;/uri&gt; </code></pre> <p>(Reposted from <a href="https://stackoverflow.com/a/10415482">https://stackoverflow.com/a/10415482</a> because this is the "official" way to avoid this bug without using reflection to modify private fields.)</p> <p><strong>Edit:</strong> The Connect bug report is no longer visible, but the <a href="http://msdn.microsoft.com/en-us/library/ee656539.aspx" rel="nofollow noreferrer">documentation for <code>&lt;schemeSettings&gt;</code></a> recommends this approach to allow escaped <code>/</code> characters in URIs. Note (as per that article) that there may be security implications for components that don't handle escaped slashes correctly.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload