1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

Fixed: Url Encode password and category for SAB

This commit is contained in:
Mark McDowall 2014-12-15 13:09:16 -08:00
parent c10f02e0b1
commit f314fab878

View File

@ -33,7 +33,7 @@ public SabnzbdProxy(Logger logger)
public SabnzbdAddResponse DownloadNzb(Byte[] nzbData, string title, string category, int priority, SabnzbdSettings settings)
{
var request = new RestRequest(Method.POST);
var action = String.Format("mode=addfile&cat={0}&priority={1}", category, priority);
var action = String.Format("mode=addfile&cat={0}&priority={1}", Uri.EscapeDataString(category), priority);
request.AddFile("name", nzbData, title, "application/x-nzb");
@ -131,7 +131,7 @@ private IRestClient BuildClient(string action, SabnzbdSettings settings)
var protocol = settings.UseSsl ? "https" : "http";
var authentication = settings.ApiKey.IsNullOrWhiteSpace() ?
String.Format("ma_username={0}&ma_password={1}", settings.Username, settings.Password) :
String.Format("ma_username={0}&ma_password={1}", settings.Username, Uri.EscapeDataString(settings.Password)) :
String.Format("apikey={0}", settings.ApiKey);
var url = String.Format(@"{0}://{1}:{2}/api?{3}&{4}&output=json",