1 parent 48043be commit c8a648aCopy full SHA for c8a648a
1 file changed
GitProtect/Program.cs
@@ -38,6 +38,25 @@
38
39
var app = builder.Build();
40
41
+app.Use((context, next) =>
42
+{
43
+ var path = context.Request.Path.Value;
44
+ if (!string.IsNullOrEmpty(path)
45
+ && (path.StartsWith("http://", StringComparison.OrdinalIgnoreCase)
46
+ || path.StartsWith("https://", StringComparison.OrdinalIgnoreCase)))
47
+ {
48
+ if (Uri.TryCreate(path, UriKind.Absolute, out var uri))
49
50
+ context.Request.Path = uri.AbsolutePath;
51
+ context.Request.QueryString = string.IsNullOrEmpty(uri.Query)
52
+ ? QueryString.Empty
53
+ : new QueryString(uri.Query);
54
+ }
55
56
+
57
+ return next();
58
+});
59
60
if (app.Environment.IsDevelopment())
61
{
62
app.UseWebAssemblyDebugging();
0 commit comments