diff --git a/src/Mvc/Mvc.Core/test/DependencyInjection/ApiBehaviorOptionsSetupTest.cs b/src/Mvc/Mvc.Core/test/DependencyInjection/ApiBehaviorOptionsSetupTest.cs index e7e8f597b532..a256f7eaf849 100644 --- a/src/Mvc/Mvc.Core/test/DependencyInjection/ApiBehaviorOptionsSetupTest.cs +++ b/src/Mvc/Mvc.Core/test/DependencyInjection/ApiBehaviorOptionsSetupTest.cs @@ -16,7 +16,7 @@ public class ApiBehaviorOptionsSetupTest public void Configure_AddsClientErrorMappings() { // Arrange - var expected = new[] { 400, 401, 403, 404, 405, 406, 408, 409, 412, 415, 422, 426, 500, 502, 503, 504 }; + var expected = new[] { 400, 401, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 421, 422, 426, 500, 501, 502, 503, 504, 505 }; var optionsSetup = new ApiBehaviorOptionsSetup(); var options = new ApiBehaviorOptions(); diff --git a/src/Shared/ProblemDetails/ProblemDetailsDefaults.cs b/src/Shared/ProblemDetails/ProblemDetailsDefaults.cs index f02a32dcc202..967c1aa48637 100644 --- a/src/Shared/ProblemDetails/ProblemDetailsDefaults.cs +++ b/src/Shared/ProblemDetails/ProblemDetailsDefaults.cs @@ -46,6 +46,12 @@ internal static class ProblemDetailsDefaults "Not Acceptable" ), + [407] = + ( + "https://tools.ietf.org/html/rfc9110#section-15.5.8", + "Proxy Authentication Required" + ), + [408] = ( "https://tools.ietf.org/html/rfc9110#section-15.5.9", @@ -58,18 +64,60 @@ internal static class ProblemDetailsDefaults "Conflict" ), + [410] = + ( + "https://tools.ietf.org/html/rfc9110#section-15.5.11", + "Gone" + ), + + [411] = + ( + "https://tools.ietf.org/html/rfc9110#section-15.5.12", + "Length Required" + ), + [412] = ( "https://tools.ietf.org/html/rfc9110#section-15.5.13", "Precondition Failed" ), + [413] = + ( + "https://tools.ietf.org/html/rfc9110#section-15.5.14", + "Content Too Large" + ), + + [414] = + ( + "https://tools.ietf.org/html/rfc9110#section-15.5.15", + "URI Too Long" + ), + [415] = ( "https://tools.ietf.org/html/rfc9110#section-15.5.16", "Unsupported Media Type" ), + [416] = + ( + "https://tools.ietf.org/html/rfc9110#section-15.5.17", + "Range Not Satisfiable" + ), + + [417] = + ( + "https://tools.ietf.org/html/rfc9110#section-15.5.18", + "Expectation Failed" + ), + + [421] = + ( + "https://tools.ietf.org/html/rfc9110#section-15.5.20", + "Misdirected Request" + ), + [422] = ( "https://tools.ietf.org/html/rfc4918#section-11.2", @@ -88,6 +136,12 @@ internal static class ProblemDetailsDefaults "An error occurred while processing your request." ), + [501] = + ( + "https://tools.ietf.org/html/rfc9110#section-15.6.2", + "Not Implemented" + ), + [502] = ( "https://tools.ietf.org/html/rfc9110#section-15.6.3", @@ -105,6 +159,12 @@ internal static class ProblemDetailsDefaults "https://tools.ietf.org/html/rfc9110#section-15.6.5", "Gateway Timeout" ), + + [505] = + ( + "https://tools.ietf.org/html/rfc9110#section-15.6.6", + "HTTP Version Not Supported" + ), }; public static void Apply(ProblemDetails problemDetails, int? statusCode)