Merge pull request #26 from WeihanLi/master
Fix build for .NET 6 with the latest SDK and some warning and typo
This commit is contained in:
		
						commit
						7907e88492
					
				@ -6,6 +6,7 @@
 | 
				
			|||||||
		<Copyright>https://github.com/dotnetcore/FastGithub</Copyright>
 | 
							<Copyright>https://github.com/dotnetcore/FastGithub</Copyright>
 | 
				
			||||||
		<RuntimeIdentifier>win-x64</RuntimeIdentifier>
 | 
							<RuntimeIdentifier>win-x64</RuntimeIdentifier>
 | 
				
			||||||
		<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
 | 
							<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
 | 
				
			||||||
 | 
							<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
 | 
				
			||||||
	</PropertyGroup>
 | 
						</PropertyGroup>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	<PropertyGroup Condition="'$(Configuration)'=='Release'">
 | 
						<PropertyGroup Condition="'$(Configuration)'=='Release'">
 | 
				
			||||||
 | 
				
			|||||||
@ -10,15 +10,15 @@ namespace FastGithub.ReverseProxy
 | 
				
			|||||||
    /// <summary>
 | 
					    /// <summary>
 | 
				
			||||||
    /// 请求日志中间件
 | 
					    /// 请求日志中间件
 | 
				
			||||||
    /// </summary>
 | 
					    /// </summary>
 | 
				
			||||||
    sealed class RequestLoggingMilldeware
 | 
					    sealed class RequestLoggingMiddleware
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        private readonly ILogger<RequestLoggingMilldeware> logger;
 | 
					        private readonly ILogger<RequestLoggingMiddleware> logger;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
        /// 请求日志中间件
 | 
					        /// 请求日志中间件
 | 
				
			||||||
        /// </summary>
 | 
					        /// </summary>
 | 
				
			||||||
        /// <param name="logger"></param>
 | 
					        /// <param name="logger"></param>
 | 
				
			||||||
        public RequestLoggingMilldeware(ILogger<RequestLoggingMilldeware> logger)
 | 
					        public RequestLoggingMiddleware(ILogger<RequestLoggingMiddleware> logger)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            this.logger = logger;
 | 
					            this.logger = logger;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -31,8 +31,7 @@ namespace FastGithub.ReverseProxy
 | 
				
			|||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public async Task InvokeAsync(HttpContext context, RequestDelegate next)
 | 
					        public async Task InvokeAsync(HttpContext context, RequestDelegate next)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var stopwatch = new Stopwatch();
 | 
					            var stopwatch = Stopwatch.StartNew();
 | 
				
			||||||
            stopwatch.Start();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
				
			|||||||
@ -16,8 +16,8 @@ namespace FastGithub
 | 
				
			|||||||
        /// <returns></returns>
 | 
					        /// <returns></returns>
 | 
				
			||||||
        public static IApplicationBuilder UseRequestLogging(this IApplicationBuilder app)
 | 
					        public static IApplicationBuilder UseRequestLogging(this IApplicationBuilder app)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var middlware = app.ApplicationServices.GetRequiredService<RequestLoggingMilldeware>();
 | 
					            var middleware = app.ApplicationServices.GetRequiredService<RequestLoggingMiddleware>();
 | 
				
			||||||
            return app.Use(next => context => middlware.InvokeAsync(context, next));
 | 
					            return app.Use(next => context => middleware.InvokeAsync(context, next));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /// <summary>
 | 
					        /// <summary>
 | 
				
			||||||
 | 
				
			|||||||
@ -19,7 +19,7 @@ namespace FastGithub
 | 
				
			|||||||
                .AddMemoryCache()
 | 
					                .AddMemoryCache()
 | 
				
			||||||
                .AddHttpForwarder()
 | 
					                .AddHttpForwarder()
 | 
				
			||||||
                .AddSingleton<CertService>()
 | 
					                .AddSingleton<CertService>()
 | 
				
			||||||
                .AddSingleton<RequestLoggingMilldeware>()
 | 
					                .AddSingleton<RequestLoggingMiddleware>()
 | 
				
			||||||
                .AddSingleton<ReverseProxyMiddleware>();
 | 
					                .AddSingleton<ReverseProxyMiddleware>();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -1,3 +1 @@
 | 
				
			|||||||
@{
 | 
					
 | 
				
			||||||
    Layout = "_Layout";
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user