Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TrySplitUriForPathEncode()

static bool System.Web.Util.UriUtil.TrySplitUriForPathEncode ( string input,
[NotNullWhen(true)] out string schemeAndAuthority,
[NotNullWhen(true)] out string path,
out string queryAndFragment )
inlinestaticpackage

Definition at line 24 of file UriUtil.cs.

25 {
26 ExtractQueryAndFragment(input, out var path2, out queryAndFragment);
27 if (Uri.TryCreate(path2, UriKind.Absolute, out Uri result))
28 {
29 string authority = result.Authority;
30 if (!string.IsNullOrEmpty(authority))
31 {
32 int num = path2.IndexOf(authority, StringComparison.OrdinalIgnoreCase);
33 if (num != -1)
34 {
35 int num2 = num + authority.Length;
36 schemeAndAuthority = path2.Substring(0, num2);
37 path = path2.Substring(num2);
38 return true;
39 }
40 }
41 }
42 schemeAndAuthority = null;
43 path = null;
44 queryAndFragment = null;
45 return false;
46 }
static void ExtractQueryAndFragment(string input, out string path, out string queryAndFragment)
Definition UriUtil.cs:9
UriKind
Definition UriKind.cs:4

References System.Web.Util.UriUtil.ExtractQueryAndFragment(), System.input, and System.Uri.TryCreate().

Referenced by System.Web.Util.HttpEncoder.UrlPathEncode().