File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
framework/src/Bing.AspNetCore/Bing/AspNetCore Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 44namespace Bing . AspNetCore . Cors
55{
66 /// <summary>
7- /// 允许CORS请求中间件
7+ /// 跨域中间件
88 /// </summary>
99 public class AllowCorsRequestMiddleware : IMiddleware
1010 {
@@ -25,6 +25,7 @@ public class AllowCorsRequestMiddleware : IMiddleware
2525 /// <param name="context">Http上下文</param>
2626 public async Task InvokeAsync ( HttpContext context )
2727 {
28+ // 若为OPTIONS跨域请求则直接返回,不进入后续管道
2829 if ( context . Request . Method . ToLower ( ) == "options" )
2930 {
3031 context . Response . StatusCode = StatusCodes . Status202Accepted ;
Original file line number Diff line number Diff line change 1010namespace Bing . AspNetCore . RealIp
1111{
1212 /// <summary>
13- /// 真实IP中间件
13+ /// 远程IP中间件
1414 /// </summary>
15+ /// <remarks>nginx 代理服务的时候需要使用才能通过RemoteIpAddress获取客户端真实IP</remarks>
1516 public class RealIpMiddleware : IMiddleware
1617 {
1718 /// <summary>
You can’t perform that action at this time.
0 commit comments