Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
60 changes: 60 additions & 0 deletions src/Shared/ProblemDetails/ProblemDetailsDefaults.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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)
Expand Down
Loading