Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
HttpUtilities.cs
Go to the documentation of this file.
1namespace System.Net.Http;
2
3internal static class HttpUtilities
4{
5 internal static bool IsSupportedScheme(string scheme)
6 {
8 {
9 return IsSupportedSecureScheme(scheme);
10 }
11 return true;
12 }
13
14 internal static bool IsSupportedNonSecureScheme(string scheme)
15 {
16 if (!string.Equals(scheme, "http", StringComparison.OrdinalIgnoreCase))
17 {
18 return IsNonSecureWebSocketScheme(scheme);
19 }
20 return true;
21 }
22
23 internal static bool IsSupportedSecureScheme(string scheme)
24 {
25 if (!string.Equals(scheme, "https", StringComparison.OrdinalIgnoreCase))
26 {
27 return IsSecureWebSocketScheme(scheme);
28 }
29 return true;
30 }
31
32 internal static bool IsNonSecureWebSocketScheme(string scheme)
33 {
34 return string.Equals(scheme, "ws", StringComparison.OrdinalIgnoreCase);
35 }
36
37 internal static bool IsSecureWebSocketScheme(string scheme)
38 {
39 return string.Equals(scheme, "wss", StringComparison.OrdinalIgnoreCase);
40 }
41
42 internal static bool IsSupportedProxyScheme(string scheme)
43 {
44 if (!string.Equals(scheme, "http", StringComparison.OrdinalIgnoreCase))
45 {
46 return IsSocksScheme(scheme);
47 }
48 return true;
49 }
50
51 internal static bool IsSocksScheme(string scheme)
52 {
53 if (!string.Equals(scheme, "socks5", StringComparison.OrdinalIgnoreCase) && !string.Equals(scheme, "socks4a", StringComparison.OrdinalIgnoreCase))
54 {
55 return string.Equals(scheme, "socks4", StringComparison.OrdinalIgnoreCase);
56 }
57 return true;
58 }
59}
static bool IsSupportedSecureScheme(string scheme)
static bool IsSupportedProxyScheme(string scheme)
static bool IsSupportedScheme(string scheme)
static bool IsSecureWebSocketScheme(string scheme)
static bool IsSocksScheme(string scheme)
static bool IsNonSecureWebSocketScheme(string scheme)
static bool IsSupportedNonSecureScheme(string scheme)