summaryrefslogtreecommitdiffstats
path: root/src/main.lib/Services/ProxyService.cs
diff options
context:
space:
mode:
authorWouter Tinus <wouter.tinus@gmail.com>2020-09-08 20:50:38 +0200
committerWouter Tinus <wouter.tinus@gmail.com>2020-09-08 20:50:38 +0200
commitd93118938f31454f19318ef3ccc872f4bf0800d7 (patch)
tree9259416fe43fc284c0ae1aec66c22b2a17ca2771 /src/main.lib/Services/ProxyService.cs
parentdb7e9e3b331775fdf30670b13509f93d6dc4a306 (diff)
downloadletsencrypt-win-simple-d93118938f31454f19318ef3ccc872f4bf0800d7.zip
letsencrypt-win-simple-d93118938f31454f19318ef3ccc872f4bf0800d7.tar.gz
letsencrypt-win-simple-d93118938f31454f19318ef3ccc872f4bf0800d7.tar.bz2
Add version to user agent
Diffstat (limited to 'src/main.lib/Services/ProxyService.cs')
-rw-r--r--src/main.lib/Services/ProxyService.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.lib/Services/ProxyService.cs b/src/main.lib/Services/ProxyService.cs
index 17e45fd..6294835 100644
--- a/src/main.lib/Services/ProxyService.cs
+++ b/src/main.lib/Services/ProxyService.cs
@@ -12,12 +12,14 @@ namespace PKISharp.WACS.Services
private readonly ILogService _log;
private IWebProxy? _proxy;
private readonly ISettingsService _settings;
+ private readonly VersionService _version;
public SslProtocols SslProtocols { get; set; } = SslProtocols.None;
- public ProxyService(ILogService log, ISettingsService settings)
+ public ProxyService(ILogService log, ISettingsService settings, VersionService version)
{
_log = log;
_settings = settings;
+ _version = version;
}
/// <summary>
@@ -44,7 +46,9 @@ namespace PKISharp.WACS.Services
{
httpClientHandler.DefaultProxyCredentials = CredentialCache.DefaultCredentials;
}
- return new HttpClient(httpClientHandler);
+ var httpClient = new HttpClient(httpClientHandler);
+ httpClient.DefaultRequestHeaders.Add("User-Agent", $"win-acme/{_version.SoftwareVersion} (+https://github.com/win-acme/win-acme)");
+ return httpClient;
}
private class LoggingHttpClientHandler : HttpClientHandler