浏览代码

SecurityException should return 403

cvium 4 年之前
父节点
当前提交
df75c1cd9c
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Jellyfin.Server/Middleware/ExceptionMiddleware.cs

+ 2 - 2
Jellyfin.Server/Middleware/ExceptionMiddleware.cs

@@ -125,8 +125,8 @@ namespace Jellyfin.Server.Middleware
             switch (ex)
             {
                 case ArgumentException _: return StatusCodes.Status400BadRequest;
-                case AuthenticationException _:
-                case SecurityException _: return StatusCodes.Status401Unauthorized;
+                case AuthenticationException _: return StatusCodes.Status401Unauthorized;
+                case SecurityException _: return StatusCodes.Status403Forbidden;
                 case DirectoryNotFoundException _:
                 case FileNotFoundException _:
                 case ResourceNotFoundException _: return StatusCodes.Status404NotFound;