Skip to content

Commit 8a6576e

Browse files
malczuuubclozel
authored andcommitted
Make HttpStatus.resolve return non-deprecated one
In previous versions, HttpStatus.resolve (or valueOf) always returned non-deprecated HTTP status for given code. This was ensured implicitly, by placing non-deprecated enum entries before their respective deprecations. This was not ensured for 413 Content Too Large. See gh-35659 Signed-off-by: Damian Malczewski <damian.m.malczewski@gmail.com>
1 parent 5accc21 commit 8a6576e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

spring-web/src/main/java/org/springframework/http/HttpStatus.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ public enum HttpStatus implements HttpStatusCode {
220220
* HTTP Semantics, section 15.5.13</a>
221221
*/
222222
PRECONDITION_FAILED(412, Series.CLIENT_ERROR, "Precondition Failed"),
223+
/**
224+
* {@code 413 Content Too Large}.
225+
* @since 7.0
226+
* @see <a href="https://datatracker.ietf.org/doc/html/rfc9110#name-413-content-too-large">
227+
* HTTP Semantics, section 15.5.14</a>
228+
*/
229+
CONTENT_TOO_LARGE(413, Series.CLIENT_ERROR, "Content Too Large"),
223230
/**
224231
* {@code 413 Payload Too Large}.
225232
* @since 4.1
@@ -229,13 +236,6 @@ public enum HttpStatus implements HttpStatusCode {
229236
*/
230237
@Deprecated(since = "7.0")
231238
PAYLOAD_TOO_LARGE(413, Series.CLIENT_ERROR, "Payload Too Large"),
232-
/**
233-
* {@code 413 Content Too Large}.
234-
* @since 7.0
235-
* @see <a href="https://datatracker.ietf.org/doc/html/rfc9110#name-413-content-too-large">
236-
* HTTP Semantics, section 15.5.14</a>
237-
*/
238-
CONTENT_TOO_LARGE(413, Series.CLIENT_ERROR, "Content Too Large"),
239239
/**
240240
* {@code 414 URI Too Long}.
241241
* @since 4.1

0 commit comments

Comments
 (0)