From 253cfcd64bf7454517b130994f9072e483c0c8c1 Mon Sep 17 00:00:00 2001 From: Eric Reed Date: Tue, 22 Sep 2015 12:39:53 -0400 Subject: [PATCH] Reroute some calls --- .../Security/PluginSecurityManager.cs | 9 ++++- .../Connect/ConnectManager.cs | 39 +++++++++++++------ 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs index 39dd41356b..ec36132980 100644 --- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs +++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs @@ -158,9 +158,14 @@ namespace MediaBrowser.Common.Implementations.Security return new SupporterInfo(); } - var url = MbAdmin.HttpsUrl + "/service/supporter/retrieve?key=" + key; + var data = new Dictionary + { + { "key", key }, + }; + + var url = MbAdmin.HttpsUrl + "/service/supporter/retrieve"; - using (var stream = await _httpClient.Get(url, CancellationToken.None).ConfigureAwait(false)) + using (var stream = await _httpClient.Post(url, data, CancellationToken.None).ConfigureAwait(false)) { var response = _jsonSerializer.DeserializeFromStream(stream); diff --git a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs index aab3a21213..f6e91528d5 100644 --- a/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs +++ b/MediaBrowser.Server.Implementations/Connect/ConnectManager.cs @@ -1079,20 +1079,25 @@ namespace MediaBrowser.Server.Implementations.Connect var url = GetConnectUrl("keyAssociation"); - url += "?serverId=" + ConnectServerId; - url += "&supporterKey=" + _securityManager.SupporterKey; - var options = new HttpRequestOptions { Url = url, CancellationToken = CancellationToken.None }; + var postData = new Dictionary + { + {"serverId", ConnectServerId}, + {"supporterKey", _securityManager.SupporterKey} + }; + + options.SetPostData(postData); + SetServerAccessToken(options); SetApplicationHeader(options); // No need to examine the response - using (var stream = (await _httpClient.SendAsync(options, "GET").ConfigureAwait(false)).Content) + using (var stream = (await _httpClient.SendAsync(options, "POST").ConfigureAwait(false)).Content) { return _json.DeserializeFromStream(stream); } @@ -1107,16 +1112,21 @@ namespace MediaBrowser.Server.Implementations.Connect var url = GetConnectUrl("keyAssociation"); - url += "?serverId=" + ConnectServerId; - url += "&supporterKey=" + _securityManager.SupporterKey; - url += "&userId=" + id; - var options = new HttpRequestOptions { Url = url, CancellationToken = CancellationToken.None }; + var postData = new Dictionary + { + {"serverId", ConnectServerId}, + {"supporterKey", _securityManager.SupporterKey}, + {"userId", id} + }; + + options.SetPostData(postData); + SetServerAccessToken(options); SetApplicationHeader(options); @@ -1135,16 +1145,21 @@ namespace MediaBrowser.Server.Implementations.Connect var url = GetConnectUrl("keyAssociation"); - url += "?serverId=" + ConnectServerId; - url += "&supporterKey=" + _securityManager.SupporterKey; - url += "&userId=" + id; - var options = new HttpRequestOptions { Url = url, CancellationToken = CancellationToken.None }; + var postData = new Dictionary + { + {"serverId", ConnectServerId}, + {"supporterKey", _securityManager.SupporterKey}, + {"userId", id} + }; + + options.SetPostData(postData); + SetServerAccessToken(options); SetApplicationHeader(options);