Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
URIs with an encoded ampersand should not decode the ampersand for HTTP requests.
A request to this URI:
should cause an HttpListenerRequest's Url property to have:
http://localhost:12345/?a=b %26 c&d=e
This allows higher-level components to differentiate between query string parameter delimiters and embedded ampersands. This is how it works in the .NET framework. Right now in Mono, the resulting Url is:
http://localhost:12345/?a=b & c&d=e
which makes it impossible to differentiate the two kinds of ampersands.
From testing it looks like the Microsoft implementation doesn't decode the URL at all. Removing the HttpUtility.UrlDecode call seems to make it work consistently with .NET in the cases I've tried.
I'll attach my test case and submit a pull request.
Created attachment 2511 [details]
This test case uses an HttpListener and WebClient to show the behavior. I created the test to work on .NET and Mono, but it would probably be lighter-weight to instantiate the HttpListenerRequest directly in a unit test that's part of mono.