From 8ff248aa629f2644602c52463329c323757a97bb Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 5 Mar 2023 20:04:31 +0800 Subject: [PATCH] bug fixes --- v2rayN/v2rayN/Handler/ConfigHandler.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/v2rayN/v2rayN/Handler/ConfigHandler.cs b/v2rayN/v2rayN/Handler/ConfigHandler.cs index 55ffed3f..f817b746 100644 --- a/v2rayN/v2rayN/Handler/ConfigHandler.cs +++ b/v2rayN/v2rayN/Handler/ConfigHandler.cs @@ -671,10 +671,6 @@ namespace v2rayN.Handler { profileItem.streamSecurity = Global.StreamSecurity; } - if (Utils.IsNullOrEmpty(profileItem.allowInsecure)) - { - profileItem.allowInsecure = config.coreBasicItem.defAllowInsecure.ToString().ToLower(); - } AddServerCommon(ref config, profileItem); @@ -827,10 +823,19 @@ namespace v2rayN.Handler public static int AddServerCommon(ref Config config, ProfileItem profileItem) { profileItem.configVersion = 2; - if (Utils.IsNullOrEmpty(profileItem.allowInsecure)) + + if (!Utils.IsNullOrEmpty(profileItem.streamSecurity)) { - profileItem.allowInsecure = config.coreBasicItem.defAllowInsecure.ToString().ToLower(); + if (Utils.IsNullOrEmpty(profileItem.allowInsecure)) + { + profileItem.allowInsecure = config.coreBasicItem.defAllowInsecure.ToString().ToLower(); + } + if (Utils.IsNullOrEmpty(profileItem.fingerprint)) + { + profileItem.fingerprint = config.coreBasicItem.defFingerprint.ToString().ToLower(); + } } + if (!Utils.IsNullOrEmpty(profileItem.network) && !Global.networks.Contains(profileItem.network)) { profileItem.network = Global.DefaultNetwork;