Skip to content

Commit 25dc0d4

Browse files
Update Middleware.cs
1 parent 3542766 commit 25dc0d4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

class/Middleware.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ public async Task Invoke(HttpContext context)
6060

6161
if (execute.FoundPage)
6262
await context.Response.WriteAsync(PageResult);
63+
else if (execute.IsAspxExtension)
64+
return;
6365
else
6466
await _next(context);
6567
}
@@ -125,7 +127,16 @@ public async Task Invoke(HttpContext context)
125127
if (execute.FoundController)
126128
await context.Response.WriteAsync(PageResult);
127129
else
128-
await _next(context);
130+
{
131+
string path = context.Request.Path.ToString();
132+
path = System.Net.WebUtility.UrlDecode(path);
133+
string extension = Path.GetExtension(path);
134+
135+
if (extension == ".aspx")
136+
return;
137+
else
138+
await _next(context);
139+
}
129140
}
130141
}
131142

0 commit comments

Comments
 (0)