瀏覽代碼

Remove unnecessary ToString in RobotsRedirectionMiddleware

Patrick Barron 1 年之前
父節點
當前提交
fa26bcde3a
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      Jellyfin.Api/Middleware/RobotsRedirectionMiddleware.cs

+ 1 - 2
Jellyfin.Api/Middleware/RobotsRedirectionMiddleware.cs

@@ -33,8 +33,7 @@ public class RobotsRedirectionMiddleware
     /// <returns>The async task.</returns>
     public async Task Invoke(HttpContext httpContext)
     {
-        var localPath = httpContext.Request.Path.ToString();
-        if (string.Equals(localPath, "/robots.txt", StringComparison.OrdinalIgnoreCase))
+        if (httpContext.Request.Path.Equals("/robots.txt", StringComparison.OrdinalIgnoreCase))
         {
             _logger.LogDebug("Redirecting robots.txt request to web/robots.txt");
             httpContext.Response.Redirect("web/robots.txt");