mirror of https://github.com/2dust/v2rayN
fix encode issue
parent
82b6ee5ad2
commit
354fc618b0
|
@ -508,7 +508,7 @@ namespace v2rayN.Handler
|
||||||
|
|
||||||
i.address = u.IdnHost;
|
i.address = u.IdnHost;
|
||||||
i.port = u.Port;
|
i.port = u.Port;
|
||||||
i.remarks = Utils.UrlDecode(u.GetComponents(UriComponents.Fragment, UriFormat.Unescaped));
|
i.remarks = u.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
|
||||||
var q = HttpUtility.ParseQueryString(u.Query);
|
var q = HttpUtility.ParseQueryString(u.Query);
|
||||||
|
|
||||||
var m = StdVmessUserInfo.Match(u.UserInfo);
|
var m = StdVmessUserInfo.Match(u.UserInfo);
|
||||||
|
@ -590,13 +590,13 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
VmessItem server = new VmessItem
|
VmessItem server = new VmessItem
|
||||||
{
|
{
|
||||||
remarks = Utils.UrlDecode(parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped)),
|
remarks = parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped),
|
||||||
address = parsedUrl.IdnHost,
|
address = parsedUrl.IdnHost,
|
||||||
port = parsedUrl.Port,
|
port = parsedUrl.Port,
|
||||||
};
|
};
|
||||||
|
|
||||||
// parse base64 UserInfo
|
// parse base64 UserInfo
|
||||||
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.Unescaped);
|
string rawUserInfo = parsedUrl.GetComponents(UriComponents.UserInfo, UriFormat.UriEscaped);
|
||||||
string userInfo = Utils.Base64Decode(rawUserInfo);
|
string userInfo = Utils.Base64Decode(rawUserInfo);
|
||||||
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2);
|
string[] userInfoParts = userInfo.Split(new char[] { ':' }, 2);
|
||||||
if (userInfoParts.Length != 2)
|
if (userInfoParts.Length != 2)
|
||||||
|
@ -712,7 +712,7 @@ namespace v2rayN.Handler
|
||||||
}
|
}
|
||||||
VmessItem server = new VmessItem
|
VmessItem server = new VmessItem
|
||||||
{
|
{
|
||||||
remarks = Utils.UrlDecode(parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped)),
|
remarks = parsedUrl.GetComponents(UriComponents.Fragment, UriFormat.Unescaped),
|
||||||
address = parsedUrl.IdnHost,
|
address = parsedUrl.IdnHost,
|
||||||
port = parsedUrl.Port,
|
port = parsedUrl.Port,
|
||||||
};
|
};
|
||||||
|
@ -741,7 +741,7 @@ namespace v2rayN.Handler
|
||||||
|
|
||||||
item.address = url.IdnHost;
|
item.address = url.IdnHost;
|
||||||
item.port = url.Port;
|
item.port = url.Port;
|
||||||
item.remarks = Utils.UrlDecode(url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped));
|
item.remarks = url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
|
||||||
item.id = url.UserInfo;
|
item.id = url.UserInfo;
|
||||||
|
|
||||||
var query = HttpUtility.ParseQueryString(url.Query);
|
var query = HttpUtility.ParseQueryString(url.Query);
|
||||||
|
@ -761,7 +761,7 @@ namespace v2rayN.Handler
|
||||||
|
|
||||||
item.address = url.IdnHost;
|
item.address = url.IdnHost;
|
||||||
item.port = url.Port;
|
item.port = url.Port;
|
||||||
item.remarks = Utils.UrlDecode(url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped));
|
item.remarks = url.GetComponents(UriComponents.Fragment, UriFormat.Unescaped);
|
||||||
item.id = url.UserInfo;
|
item.id = url.UserInfo;
|
||||||
|
|
||||||
var query = HttpUtility.ParseQueryString(url.Query);
|
var query = HttpUtility.ParseQueryString(url.Query);
|
||||||
|
|
|
@ -370,7 +370,8 @@ namespace v2rayN
|
||||||
|
|
||||||
public static string UrlEncode(string url)
|
public static string UrlEncode(string url)
|
||||||
{
|
{
|
||||||
return HttpUtility.UrlEncode(url);
|
return Uri.EscapeDataString(url);
|
||||||
|
//return HttpUtility.UrlEncode(url);
|
||||||
}
|
}
|
||||||
public static string UrlDecode(string url)
|
public static string UrlDecode(string url)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue