Skip to content

Commit

Permalink
Update ConfigHandler.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Jun 24, 2024
1 parent a28c631 commit b583590
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions v2rayN/v2rayN/Handler/ConfigHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1360,18 +1360,23 @@ public static int AddSubItem(Config config, string url)
{
return 0;
}

var uri = new Uri(url);
var queryVars = HttpUtility.ParseQueryString(uri.Query);
string remarks = queryVars["remarks"] ?? "import_sub";

SubItem subItem = new()
{
id = string.Empty,
remarks = remarks,
url = url
};

try
{
var uri = new Uri(url);
var queryVars = HttpUtility.ParseQueryString(uri.Query);
subItem.remarks = queryVars["remarks"] ?? "import_sub";
}
catch (UriFormatException)
{
return 0;
}

return AddSubItem(config, subItem);
}

Expand Down

0 comments on commit b583590

Please sign in to comment.