Browse Source

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>
pull/35684/head
Damian Malczewski 5 months ago committed by Brian Clozel
parent
commit
8a6576eace
  1. 14
      spring-web/src/main/java/org/springframework/http/HttpStatus.java

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

@ -220,6 +220,13 @@ public enum HttpStatus implements HttpStatusCode { @@ -220,6 +220,13 @@ public enum HttpStatus implements HttpStatusCode {
* HTTP Semantics, section 15.5.13</a>
*/
PRECONDITION_FAILED(412, Series.CLIENT_ERROR, "Precondition Failed"),
/**
* {@code 413 Content Too Large}.
* @since 7.0
* @see <a href="https://datatracker.ietf.org/doc/html/rfc9110#name-413-content-too-large">
* HTTP Semantics, section 15.5.14</a>
*/
CONTENT_TOO_LARGE(413, Series.CLIENT_ERROR, "Content Too Large"),
/**
* {@code 413 Payload Too Large}.
* @since 4.1
@ -229,13 +236,6 @@ public enum HttpStatus implements HttpStatusCode { @@ -229,13 +236,6 @@ public enum HttpStatus implements HttpStatusCode {
*/
@Deprecated(since = "7.0")
PAYLOAD_TOO_LARGE(413, Series.CLIENT_ERROR, "Payload Too Large"),
/**
* {@code 413 Content Too Large}.
* @since 7.0
* @see <a href="https://datatracker.ietf.org/doc/html/rfc9110#name-413-content-too-large">
* HTTP Semantics, section 15.5.14</a>
*/
CONTENT_TOO_LARGE(413, Series.CLIENT_ERROR, "Content Too Large"),
/**
* {@code 414 URI Too Long}.
* @since 4.1

Loading…
Cancel
Save