forked from BeyondDimension/SteamTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathForwardHelper.cs
More file actions
43 lines (37 loc) · 1.52 KB
/
ForwardHelper.cs
File metadata and controls
43 lines (37 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//using System.Linq;
//using System.Net.Http;
//using System.Text;
//namespace System.Application
//{
// /// <summary>
// /// 转发助手
// /// </summary>
// [Obsolete("Http Error 403", true)]
// public static class ForwardHelper
// {
// /// <summary>
// /// 定义一组需要转发的URL
// /// </summary>
// [Obsolete("Http Error 403", true)]
// public static readonly string[] allowUrls = new[] {
// "https://steamcommunity.com/",
// };
// [Obsolete("Http Error 403", true)]
// public static bool IsAllowUrl(string requestUri)
// {
// return allowUrls.Any(x => requestUri.StartsWith(x, StringComparison.OrdinalIgnoreCase));
// }
// [Obsolete("Http Error 403", true)]
// public static string GetForwardRelativeUrl(string url) => $"api/forward?url={url.Base64UrlEncode()}";
// [Obsolete("Http Error 403", true)]
// public static string GetForwardRelativeUrl(Uri url) => GetForwardRelativeUrl(url.ToString());
// [Obsolete("Http Error 403", true)]
// public static string GetForwardRelativeUrl(HttpRequestMessage request) => GetForwardRelativeUrl(request.RequestUri.ThrowIsNull(nameof(request.RequestUri)));
// [Obsolete("Http Error 403", true)]
// public static string CombineAbsoluteUrl(string baseUrl, string relativeUrl)
// {
// if (baseUrl.EndsWith('/')) return baseUrl + relativeUrl;
// return $"{baseUrl}/{relativeUrl}";
// }
// }
//}