aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-09-07 12:24:42 -0400
committerLukePulverenti Luke Pulverenti luke pulverenti <LukePulverenti Luke Pulverenti luke.pulverenti@gmail.com>2012-09-07 12:24:42 -0400
commit90c609c159d7746352fa3481550b44fcd5090f6d (patch)
tree0b843f7b1cd400c6c0a792447d39a626950144af
parent8fc828361e6e6019bc833ffba1d5ef8fc8605ac9 (diff)
Only add password to the form post if not null or empty
-rw-r--r--MediaBrowser.ApiInteraction/ApiClient.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs
index 0315d9dd9..8e6859a48 100644
--- a/MediaBrowser.ApiInteraction/ApiClient.cs
+++ b/MediaBrowser.ApiInteraction/ApiClient.cs
@@ -353,7 +353,12 @@ namespace MediaBrowser.ApiInteraction
string url = ApiUrl + "/UserAuthentication?dataformat=" + SerializationFormat.ToString();
// Create the post body
- string postContent = string.Format("userid={0}&password={1}", userId, password);
+ string postContent = string.Format("userid={0}", userId);
+
+ if (!string.IsNullOrEmpty(password))
+ {
+ postContent += "&password=" + password;
+ }
HttpContent content = new StringContent(postContent, Encoding.UTF8, "application/x-www-form-urlencoded");