aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Middleware/ExceptionMiddleware.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Server/Middleware/ExceptionMiddleware.cs')
-rw-r--r--Jellyfin.Server/Middleware/ExceptionMiddleware.cs8
1 files changed, 2 insertions, 6 deletions
diff --git a/Jellyfin.Server/Middleware/ExceptionMiddleware.cs b/Jellyfin.Server/Middleware/ExceptionMiddleware.cs
index 63effafc1..db7877c31 100644
--- a/Jellyfin.Server/Middleware/ExceptionMiddleware.cs
+++ b/Jellyfin.Server/Middleware/ExceptionMiddleware.cs
@@ -125,7 +125,8 @@ namespace Jellyfin.Server.Middleware
switch (ex)
{
case ArgumentException _: return StatusCodes.Status400BadRequest;
- case SecurityException _: return StatusCodes.Status401Unauthorized;
+ case AuthenticationException _: return StatusCodes.Status401Unauthorized;
+ case SecurityException _: return StatusCodes.Status403Forbidden;
case DirectoryNotFoundException _:
case FileNotFoundException _:
case ResourceNotFoundException _: return StatusCodes.Status404NotFound;
@@ -136,11 +137,6 @@ namespace Jellyfin.Server.Middleware
private string NormalizeExceptionMessage(string msg)
{
- if (msg == null)
- {
- return string.Empty;
- }
-
// Strip any information we don't want to reveal
return msg.Replace(
_configuration.ApplicationPaths.ProgramSystemPath,