diff options
| author | JP Dillingham <jp@dillingham.me> | 2024-01-06 17:19:31 -0600 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2024-01-06 17:19:31 -0600 |
| commit | 9659015d025fb0d4276106e8bcc8333942c094fd (patch) | |
| tree | d96a4d9c55d00b3902fe3a13c3933992ee103e6e /src/slskd/Relay | |
| parent | 8538d22cd30ff51f7641fc07b3793534874fa18f (diff) | |
| download | slskd-9659015d025fb0d4276106e8bcc8333942c094fd.tar.gz | |
resolve more warnings
Diffstat (limited to 'src/slskd/Relay')
| -rw-r--r-- | src/slskd/Relay/RelayClient.cs | 4 | ||||
| -rw-r--r-- | src/slskd/Relay/RelayService.cs | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/slskd/Relay/RelayClient.cs b/src/slskd/Relay/RelayClient.cs index f3880c97..b54a04f3 100644 --- a/src/slskd/Relay/RelayClient.cs +++ b/src/slskd/Relay/RelayClient.cs @@ -259,7 +259,9 @@ namespace slskd.Relay { if (message is HttpClientHandler clientHandler && options.Relay.Controller.IgnoreCertificateErrors) { +#pragma warning disable S4830 // Enable server certificate validation on this SSL/TLS connection clientHandler.ServerCertificateCustomValidationCallback += (_, _, _, _) => true; +#pragma warning restore S4830 // Enable server certificate validation on this SSL/TLS connection } return message; @@ -304,7 +306,9 @@ namespace slskd.Relay client = new HttpClient(new HttpClientHandler() { ClientCertificateOptions = ClientCertificateOption.Manual, +#pragma warning disable S4830 // Enable server certificate validation on this SSL/TLS connection ServerCertificateCustomValidationCallback = (_, _, _, _) => true, +#pragma warning restore S4830 // Enable server certificate validation on this SSL/TLS connection }); } else diff --git a/src/slskd/Relay/RelayService.cs b/src/slskd/Relay/RelayService.cs index 6cbbb0a2..d3f35693 100644 --- a/src/slskd/Relay/RelayService.cs +++ b/src/slskd/Relay/RelayService.cs @@ -624,7 +624,7 @@ namespace slskd.Relay // ensure filename is relative to the local download directory and make sure it doesn't start with a slash filename = filename .ReplaceFirst(OptionsMonitor.CurrentValue.Directories.Downloads, string.Empty) - .TrimStart(new[] { '/', '\\' }); + .TrimStart('/', '\\'); async Task Notify((string ConnectionId, Agent Agent) record) { |
