From 70662dc181615cdca2d2e5ce0d9381cf56b8431a Mon Sep 17 00:00:00 2001 From: Federico Date: Sat, 10 Aug 2019 18:00:42 +0200 Subject: [PATCH] Made MegaApiClient compatible with Unity3d IL2CPP Replaced HttpUtility.ParseQueryString with a simple string concatenation. --- MegaApiClient/MegaApiClient.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/MegaApiClient/MegaApiClient.cs b/MegaApiClient/MegaApiClient.cs index 4e47e4a..4799287 100644 --- a/MegaApiClient/MegaApiClient.cs +++ b/MegaApiClient/MegaApiClient.cs @@ -1077,11 +1077,12 @@ private Uri GenerateUrl(Dictionary queryArguments) return new Uri(Microsoft.AspNetCore.WebUtilities.QueryHelpers.AddQueryString(BaseApiUri.AbsoluteUri, query)); #else UriBuilder builder = new UriBuilder(BaseApiUri); - var arguments = System.Web.HttpUtility.ParseQueryString(builder.Query); + var arguments = ""; foreach (var item in query) { - arguments.Add(item.Key, item.Value); + arguments = arguments + item.Key + "=" + item.Value + "&"; } + arguments = arguments.Substring(0, arguments.Length - 1); builder.Query = arguments.ToString(); return builder.Uri;