From 90c609c159d7746352fa3481550b44fcd5090f6d Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Fri, 7 Sep 2012 12:24:42 -0400 Subject: [PATCH] Only add password to the form post if not null or empty --- MediaBrowser.ApiInteraction/ApiClient.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs index 0315d9dd9a..8e6859a484 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");