mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-25 22:37:27 -04:00
Added UserAgent to RestClient.
This commit is contained in:
committed by
Mark McDowall
parent
e9f39493f4
commit
9a649cf58e
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using RestSharp;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
|
||||
namespace NzbDrone.Core.Rest
|
||||
{
|
||||
public static class RestClientFactory
|
||||
{
|
||||
public static RestClient BuildClient(String baseUrl)
|
||||
{
|
||||
var restClient = new RestClient(baseUrl);
|
||||
|
||||
restClient.UserAgent = String.Format("NzbDrone/{0} (RestSharp/{1}; {2}/{3})",
|
||||
BuildInfo.Version,
|
||||
restClient.GetType().Assembly.GetName().Version,
|
||||
OsInfo.Os, OsInfo.Version.ToString(2));
|
||||
|
||||
return restClient;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user