From 3bbd1142d9a0714c9f667d196972b50b4141c4e8 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sun, 20 Oct 2024 13:53:29 -0400 Subject: [PATCH] Fix some bad authority HTTP response code handling --- src/Tgstation.Server.Host/Authority/Core/AuthorityBase.cs | 4 ++-- .../Authority/Core/RestAuthorityInvoker{TAuthority}.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tgstation.Server.Host/Authority/Core/AuthorityBase.cs b/src/Tgstation.Server.Host/Authority/Core/AuthorityBase.cs index f0e39151a3..0ea01a89da 100644 --- a/src/Tgstation.Server.Host/Authority/Core/AuthorityBase.cs +++ b/src/Tgstation.Server.Host/Authority/Core/AuthorityBase.cs @@ -60,7 +60,7 @@ namespace Tgstation.Server.Host.Authority.Core /// A new, errored . protected static AuthorityResponse Gone() => new( - new ErrorMessageResponse(), + new ErrorMessageResponse(ErrorCode.ResourceNotPresent), HttpFailureResponse.Gone); /// @@ -80,7 +80,7 @@ namespace Tgstation.Server.Host.Authority.Core /// A new, errored . protected static AuthorityResponse NotFound() => new( - new ErrorMessageResponse(), + new ErrorMessageResponse(ErrorCode.ResourceNeverPresent), HttpFailureResponse.NotFound); /// diff --git a/src/Tgstation.Server.Host/Authority/Core/RestAuthorityInvoker{TAuthority}.cs b/src/Tgstation.Server.Host/Authority/Core/RestAuthorityInvoker{TAuthority}.cs index 91118a5586..52532c2f0e 100644 --- a/src/Tgstation.Server.Host/Authority/Core/RestAuthorityInvoker{TAuthority}.cs +++ b/src/Tgstation.Server.Host/Authority/Core/RestAuthorityInvoker{TAuthority}.cs @@ -55,7 +55,7 @@ namespace Tgstation.Server.Host.Authority.Core return failureResponse switch { HttpFailureResponse.BadRequest => controller.BadRequest(errorMessage), - HttpFailureResponse.Unauthorized => controller.Unauthorized(errorMessage), + HttpFailureResponse.Unauthorized => controller.Unauthorized(), HttpFailureResponse.Forbidden => controller.Forbid(), HttpFailureResponse.NotFound => controller.NotFound(errorMessage), HttpFailureResponse.NotAcceptable => controller.StatusCode(HttpStatusCode.NotAcceptable, errorMessage),