Skip to content

Commit 3189aeb

Browse files
Merge pull request #25 from windows-toolkit/michael-hawker/mock-fix
Add hack for MockProvider to workaround SDK issue
2 parents 2c1d935 + bc9b12f commit 3189aeb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Microsoft.Toolkit.Graph/Providers/MockProvider.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ private set
4545
"https://proxy.apisandbox.msdn.microsoft.com/svc?url=" + HttpUtility.HtmlEncode("https://graph.microsoft.com/beta/"),
4646
new DelegateAuthenticationProvider((requestMessage) =>
4747
{
48+
//// Temporary Workaround for https://github.com/microsoftgraph/msgraph-sdk-dotnet-core/issues/59
49+
//// ------------------------
50+
var requestUri = requestMessage.RequestUri.ToString();
51+
var index = requestUri.IndexOf("&");
52+
if (index >= 0)
53+
{
54+
requestMessage.RequestUri = new Uri(requestUri.Remove(index, 1).Insert(index, "?"));
55+
}
56+
57+
//// End Workaround
58+
4859
return this.AuthenticateRequestAsync(requestMessage);
4960
}));
5061

0 commit comments

Comments
 (0)