Parcourir la source

Addressing review feedback

Vasily il y a 5 ans
Parent
commit
61d9c9df5b
1 fichiers modifiés avec 2 ajouts et 6 suppressions
  1. 2 6
      Emby.Server.Implementations/HttpServer/HttpListenerHost.cs

+ 2 - 6
Emby.Server.Implementations/HttpServer/HttpListenerHost.cs

@@ -242,9 +242,7 @@ namespace Emby.Server.Implementations.HttpServer
 
         private async Task ErrorHandler(Exception ex, IRequest httpReq, bool logExceptionStackTrace, string urlToLog)
         {
-            string urlSuffix = string.IsNullOrWhiteSpace(urlToLog)
-                ? string.Format(CultureInfo.InvariantCulture, "; URL being processed: {0}", urlToLog)
-                : "";
+            string urlSuffix = string.Format(CultureInfo.InvariantCulture, "; URL being processed: {0}", urlToLog);
             try
             {
                 ex = GetActualException(ex);
@@ -460,7 +458,7 @@ namespace Emby.Server.Implementations.HttpServer
             var stopWatch = new Stopwatch();
             stopWatch.Start();
             var httpRes = httpReq.Response;
-            string urlToLog = null;
+            string urlToLog = GetUrlToLog(urlString);
             string remoteIp = httpReq.RemoteIp;
 
             try
@@ -506,8 +504,6 @@ namespace Emby.Server.Implementations.HttpServer
                     return;
                 }
 
-                urlToLog = GetUrlToLog(urlString);
-
                 if (string.Equals(localPath, _baseUrlPrefix + "/", StringComparison.OrdinalIgnoreCase)
                     || string.Equals(localPath, _baseUrlPrefix, StringComparison.OrdinalIgnoreCase)
                     || string.Equals(localPath, "/", StringComparison.OrdinalIgnoreCase)