From fa48ccee4edd883d838e66a505b56864df6f397b Mon Sep 17 00:00:00 2001 From: zel Date: Tue, 25 Feb 2025 15:34:46 +0800 Subject: [PATCH] 1 --- ZelWiki/ExceptionHandlingMiddleware.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZelWiki/ExceptionHandlingMiddleware.cs b/ZelWiki/ExceptionHandlingMiddleware.cs index 39bce80..386d130 100644 --- a/ZelWiki/ExceptionHandlingMiddleware.cs +++ b/ZelWiki/ExceptionHandlingMiddleware.cs @@ -34,14 +34,14 @@ namespace ZelWiki } catch (Exception ex) { - string request = $"{context.Request.Path}{context.Request.QueryString}"; + var request = $"{context.Request.Path}{context.Request.QueryString}"; var routeValues = new StringBuilder(); foreach (var rv in context.Request.RouteValues) { routeValues.AppendLine($"{rv},"); } - if (routeValues.Length > 1) routeValues.Length--; //Trim trailing comma. + if (routeValues.Length > 1) routeValues.Length--; var exceptionText = $"IP Address: {context.Connection.RemoteIpAddress},\r\n Request: {request},\r\n RouteValues: {routeValues}\r\n";