Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Feb 21, 2024
1 parent 2a338d9 commit 0b3635b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 29 deletions.
5 changes: 4 additions & 1 deletion v2rayN/v2rayN/Common/Utile.cs
Expand Up @@ -325,7 +325,10 @@ public static NameValueCollection ParseQueryString(string query)
var key = Uri.UnescapeDataString(keyValue[0]);
var val = Uri.UnescapeDataString(keyValue[1]);

result.Add(key, val);
if (result[key] is null)
{
result.Add(key, val);
}
}

return result;
Expand Down
16 changes: 12 additions & 4 deletions v2rayN/v2rayN/Handler/ConfigHandler.cs
Expand Up @@ -956,13 +956,21 @@ public static int AddServerCommon(Config config, ProfileItem profileItem, bool t

if (!Utile.IsNullOrEmpty(profileItem.streamSecurity))
{
if (Utile.IsNullOrEmpty(profileItem.allowInsecure))
if (profileItem.streamSecurity != Global.StreamSecurity
&& profileItem.streamSecurity != Global.StreamSecurityReality)
{
profileItem.allowInsecure = config.coreBasicItem.defAllowInsecure.ToString().ToLower();
profileItem.streamSecurity = string.Empty;
}
if (Utile.IsNullOrEmpty(profileItem.fingerprint) && profileItem.streamSecurity == Global.StreamSecurityReality)
else
{
profileItem.fingerprint = config.coreBasicItem.defFingerprint;
if (Utile.IsNullOrEmpty(profileItem.allowInsecure))
{
profileItem.allowInsecure = config.coreBasicItem.defAllowInsecure.ToString().ToLower();
}
if (Utile.IsNullOrEmpty(profileItem.fingerprint) && profileItem.streamSecurity == Global.StreamSecurityReality)
{
profileItem.fingerprint = config.coreBasicItem.defFingerprint;
}
}
}

Expand Down
48 changes: 24 additions & 24 deletions v2rayN/v2rayN/Resx/ResUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0b3635b

Please sign in to comment.