Fix some warnings and typo

This commit is contained in:
weihanli 2021-08-12 22:48:55 +08:00
parent ec6871a614
commit e21bb99994
4 changed files with 8 additions and 11 deletions

View File

@ -10,15 +10,15 @@ namespace FastGithub.ReverseProxy
/// <summary>
/// 请求日志中间件
/// </summary>
sealed class RequestLoggingMilldeware
sealed class RequestLoggingMiddleware
{
private readonly ILogger<RequestLoggingMilldeware> logger;
private readonly ILogger<RequestLoggingMiddleware> logger;
/// <summary>
/// 请求日志中间件
/// </summary>
/// <param name="logger"></param>
public RequestLoggingMilldeware(ILogger<RequestLoggingMilldeware> logger)
public RequestLoggingMiddleware(ILogger<RequestLoggingMiddleware> logger)
{
this.logger = logger;
}
@ -31,8 +31,7 @@ namespace FastGithub.ReverseProxy
/// <returns></returns>
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
var stopwatch = new Stopwatch();
stopwatch.Start();
var stopwatch = Stopwatch.StartNew();
try
{

View File

@ -16,8 +16,8 @@ namespace FastGithub
/// <returns></returns>
public static IApplicationBuilder UseRequestLogging(this IApplicationBuilder app)
{
var middlware = app.ApplicationServices.GetRequiredService<RequestLoggingMilldeware>();
return app.Use(next => context => middlware.InvokeAsync(context, next));
var middleware = app.ApplicationServices.GetRequiredService<RequestLoggingMiddleware>();
return app.Use(next => context => middleware.InvokeAsync(context, next));
}
/// <summary>

View File

@ -19,7 +19,7 @@ namespace FastGithub
.AddMemoryCache()
.AddHttpForwarder()
.AddSingleton<CertService>()
.AddSingleton<RequestLoggingMilldeware>()
.AddSingleton<RequestLoggingMiddleware>()
.AddSingleton<ReverseProxyMiddleware>();
}
}

View File

@ -1,3 +1 @@
@{
Layout = "_Layout";
}