diff --git a/src/sdk/CHANGELOG.md b/src/sdk/CHANGELOG.md index 9a21d33e87..a2453291e5 100644 --- a/src/sdk/CHANGELOG.md +++ b/src/sdk/CHANGELOG.md @@ -29,6 +29,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Admin library: Extra parameters to configure the SharePoint Add-In and Azure ACS principal loading [jansenbe - Bert Jansen] - Changed `IList.DraftVersionVisibility` to use enum `DraftVisibilityType` instead of an `int` #1286 [jansenbe - Bert Jansen] - Fixing URL too long issue when downloading files #1290 [koenzomers - Koen Zomers] +- Fixed regression coming from #1290 #1297 [jansenbe - Bert Jansen] ## [1.10.0] diff --git a/src/sdk/PnP.Core/Services/Core/Query/QueryClient.cs b/src/sdk/PnP.Core/Services/Core/Query/QueryClient.cs index 5b55bcb4d5..c18ff45002 100644 --- a/src/sdk/PnP.Core/Services/Core/Query/QueryClient.cs +++ b/src/sdk/PnP.Core/Services/Core/Query/QueryClient.cs @@ -164,7 +164,16 @@ private static async Task BuildGetAPICallRestAsync(BaseD // In .NET Framework to ToString() of a NameValueCollection will use HttpUtility.UrlEncodeUnicode under // the covers resulting in issues. So we decode and encode again as a workaround. This code produces the // same result when used under .NET5/Core versus .NET Framework - sb.Append($"?{queryString.ToEncodedString()}"); + + // The base query string can already contain a URL parameter (e.g. _api/Web/getFileByServerRelativePath(decodedUrl=@u)?@u='') + if (baseApiCall.Contains('?')) + { + sb.Append($"&{queryString.ToEncodedString()}"); + } + else + { + sb.Append($"?{queryString.ToEncodedString()}"); + } } // Create ApiCall instance and call the override option if needed