Bug 60473 - Wrong URI escaping in AndroidClientHandler when no query parameters passed
Summary: Wrong URI escaping in AndroidClientHandler when no query parameters passed
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Habersack
URL:
: 61025 ()
Depends on:
Blocks:
 
Reported: 2017-11-01 13:29 UTC by Alexander
Modified: 2017-12-07 16:33 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 Developer Community or GitHub 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.

Related Links:
Status:
RESOLVED FIXED

Description Alexander 2017-11-01 13:29:29 UTC
The problem is with this method - https://github.com/xamarin/xamarin-android/blob/c43c5e671aa57a56f7ba5abc3423e9906af51a83/src/Mono.Android/Xamarin.Android.Net/AndroidClientHandler.cs#L205

If you pass escaped URI without query parameters it escapes '%' chars second time.

So if you pass:
https://www.example.com/find/user/at%40example.com
request will be performed with following URI:
https://www.example.com/find/user/at%2540example.com

But, if you pass same escaped URI with dummy query parameter, like:
https://www.example.com/find/user/at%40example.com?dummy=yeah
it translates correctly to:
https://www.example.com/find/user/at%40example.com?dummy=yeah

I think this behaviour isn't intentional.
Comment 1 Marek Habersack 2017-11-02 12:58:19 UTC
PR opened: https://github.com/xamarin/xamarin-android/pull/1001
Comment 2 Marek Habersack 2017-11-02 19:43:58 UTC
Fixed in xamarin-android/master (commit https://github.com/xamarin/xamarin-android/commit/e6b85552ef2a9bc6e73f36fbab0ab94682f5dd65)
Comment 3 Justin Toth 2017-12-07 16:33:34 UTC
*** Bug 61025 has been marked as a duplicate of this bug. ***