diff --git a/src/main/java/org/kiwiproject/net/KiwiHttpResponses.java b/src/main/java/org/kiwiproject/net/KiwiHttpResponses.java index e75904e5..fc76d92b 100644 --- a/src/main/java/org/kiwiproject/net/KiwiHttpResponses.java +++ b/src/main/java/org/kiwiproject/net/KiwiHttpResponses.java @@ -346,12 +346,16 @@ public static boolean preconditionFailed(int statusCode) { } /** - * Check if the given status code is 413 Payload Too Large. + * Check if the given status code is 413 Content Too Large. + *

+ * According to the Mozilla documentation, this used to be + * known as Payload Too Large, and that terminology is still + * apparently widely used. * * @param statusCode the status code to check * @return true if the status code is 413, otherwise false */ - public static boolean payloadTooLarge(int statusCode) { + public static boolean contentTooLarge(int statusCode) { return statusCode == 413; } @@ -583,7 +587,7 @@ public static String reasonPhraseOf(int statusCode) { case 410 -> "Gone"; case 411 -> "Length Required"; case 412 -> "Precondition Failed"; - case 413 -> "Payload Too Large"; + case 413 -> "Content Too Large"; case 414 -> "URI Too Long"; case 415 -> "Unsupported Media Type"; case 416 -> "Range Not Satisfiable"; diff --git a/src/test/java/org/kiwiproject/net/KiwiHttpResponsesTest.java b/src/test/java/org/kiwiproject/net/KiwiHttpResponsesTest.java index 7fdb551d..c6c0a333 100644 --- a/src/test/java/org/kiwiproject/net/KiwiHttpResponsesTest.java +++ b/src/test/java/org/kiwiproject/net/KiwiHttpResponsesTest.java @@ -111,7 +111,7 @@ void shouldPassStatusCodeChecks(int statusCode) { () -> assertThat(KiwiHttpResponses.preconditionFailed(statusCode)) .isEqualTo(statusCode == 412), - () -> assertThat(KiwiHttpResponses.payloadTooLarge(statusCode)) + () -> assertThat(KiwiHttpResponses.contentTooLarge(statusCode)) .isEqualTo(statusCode == 413), () -> assertThat(KiwiHttpResponses.uriTooLong(statusCode))