mirror of
https://github.com/lidarr/Lidarr
synced 2025-01-30 02:41:45 +00:00
Fixed: Setting SSL Cert Hash should remove all extra characters
This commit is contained in:
parent
ac4f2d5e9a
commit
9056bc1747
1 changed files with 8 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using NzbDrone.Common;
|
||||
|
@ -49,6 +50,7 @@ public class ConfigFileProvider : IConfigFileProvider
|
|||
private readonly ICached<string> _cache;
|
||||
|
||||
private readonly string _configFile;
|
||||
private static readonly Regex HiddenCharacterRegex = new Regex("[^a-z0-9]", RegexOptions.Compiled | RegexOptions.IgnoreCase);
|
||||
|
||||
public ConfigFileProvider(IAppFolderInfo appFolderInfo, ICacheManager cacheManager, IEventAggregator eventAggregator)
|
||||
{
|
||||
|
@ -87,6 +89,12 @@ public void SaveConfigDictionary(Dictionary<string, object> configValues)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (configValue.Key.Equals("SslCertHash", StringComparison.InvariantCultureIgnoreCase) && configValue.Value.ToString().IsNotNullOrWhiteSpace())
|
||||
{
|
||||
SetValue(configValue.Key.FirstCharToUpper(), HiddenCharacterRegex.Replace(configValue.Value.ToString(), String.Empty));
|
||||
continue;
|
||||
}
|
||||
|
||||
object currentValue;
|
||||
allWithDefaults.TryGetValue(configValue.Key, out currentValue);
|
||||
if (currentValue == null) continue;
|
||||
|
|
Loading…
Reference in a new issue