1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-17 15:02:34 +02:00

Changed UserAgent to Sonarr

This commit is contained in:
Mark McDowall 2014-11-25 07:28:49 -08:00
parent 86a12f95d2
commit 70f07845fd
3 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ public class HttpClient : IHttpClient
public HttpClient(Logger logger) public HttpClient(Logger logger)
{ {
_logger = logger; _logger = logger;
_userAgent = String.Format("NzbDrone/{0} ({1} {2})", _userAgent = String.Format("Sonarr/{0} ({1} {2})",
BuildInfo.Version, BuildInfo.Version,
OsInfo.Os, OsInfo.Version.ToString(2)); OsInfo.Os, OsInfo.Version.ToString(2));
ServicePointManager.DefaultConnectionLimit = 12; ServicePointManager.DefaultConnectionLimit = 12;
@ -207,7 +207,7 @@ protected virtual void AddRequestHeaders(HttpWebRequest webRequest, HttpHeader h
webRequest.TransferEncoding = header.Value.ToString(); webRequest.TransferEncoding = header.Value.ToString();
break; break;
case "User-Agent": case "User-Agent":
throw new NotSupportedException("User-Agent other than NzbDrone not allowed."); throw new NotSupportedException("User-Agent other than Sonarr not allowed.");
case "Proxy-Connection": case "Proxy-Connection":
throw new NotImplementedException(); throw new NotImplementedException();
break; break;

View File

@ -24,7 +24,7 @@ public class HttpProvider : IHttpProvider
public HttpProvider(Logger logger) public HttpProvider(Logger logger)
{ {
_logger = logger; _logger = logger;
_userAgent = String.Format("NzbDrone {0}", BuildInfo.Version); _userAgent = String.Format("Sonarr {0}", BuildInfo.Version);
ServicePointManager.Expect100Continue = false; ServicePointManager.Expect100Continue = false;
} }

View File

@ -13,7 +13,7 @@ public static RestClient BuildClient(String baseUrl)
{ {
var restClient = new RestClient(baseUrl); var restClient = new RestClient(baseUrl);
restClient.UserAgent = String.Format("NzbDrone/{0} (RestSharp/{1}; {2}/{3})", restClient.UserAgent = String.Format("Sonarr/{0} (RestSharp/{1}; {2}/{3})",
BuildInfo.Version, BuildInfo.Version,
restClient.GetType().Assembly.GetName().Version, restClient.GetType().Assembly.GetName().Version,
OsInfo.Os, OsInfo.Version.ToString(2)); OsInfo.Os, OsInfo.Version.ToString(2));