Skip to content

Modify status code 103 to ("Early Hints") #27960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

waisink
Copy link

@waisink waisink commented Jan 20, 2022

According to rfc8297(https://tools.ietf.org/html/rfc8297), the reason
phase of status code 103 should be "Early Hints", not "Checkpoint".

This commit modifies the status code 103 reason phase from ("Checkpoint")
to ("Early Hints").

According to rfc8297(https://tools.ietf.org/html/rfc8297), the reason
phase of status code 103 should be "Early Hints", not "Checkpoint".

This commit modifies the status code 103 reason phase from ("Checkpoint")
to ("Early Hints").
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 20, 2022
@bclozel bclozel added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jan 20, 2022
@bclozel bclozel added this to the 6.0.x milestone Jan 20, 2022
@bclozel bclozel added the in: web Issues in web modules (web, webmvc, webflux, websocket) label Jan 20, 2022
@sbrannen sbrannen marked this pull request as draft January 20, 2022 13:35
Copy link
Member

@sbrannen sbrannen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We unfortunately cannot accept the current proposal since it introduces breaking changes -- by changing the names of existing methods and constants.

The correct way to achieve this would be to introduce the new constants and methods and simultaneously deprecate the existing ones (pointing to the new variants).

@sbrannen sbrannen added the status: waiting-for-feedback We need additional information before we can continue label Jan 20, 2022
@waisink
Copy link
Author

waisink commented Jan 21, 2022

Thank you for replying and suggesting.

However i am wondering that if preserve the old constants, is that ok when use old constants value to call the method HttpStatus.valueOf as the following expression return false

HttpStatus.CHECKPOINT.equals(HttpStatus.valueOf(HttpStatus.CHECKPOINT.value()))

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Jan 21, 2022
simonbasle added a commit to simonbasle/spring-framework that referenced this pull request Jan 13, 2023
This commit takes rfc8297 into account and introduces a newer code 103
HttpStatus value which uses `Early Hints` as the more correct reason
phrase, deprecating the outdated `CHECKPOINT` enum value for 103.

Additionally:
  - `HttpStatus.valueOf(103)` will return the new enum value
  - `HttpStatusCode#isSameCodeAs(HttpStatusCode)` is introduced to ease
  comparison of deprecated enums vs their newer counterparts (or any
  instance of a more generic `HttpStatusCode`) by comparing the integer
  `value()`
  - `HttpStatusTests` covers the new deprecation as well as the three
  previously deprecated codes, including a check with the above new
  method to ensure they have comparable integer values

Supersedes and Closes spring-projectsgh-27960
@simonbasle
Copy link
Contributor

@waisink I implemented a change with the same goal as yours but going down the deprecation road in #29816, with an additional method to compare arbitrary status codes' value

simonbasle added a commit that referenced this pull request Jan 16, 2023
This commit takes rfc8297 into account and introduces a newer code 103
HttpStatus value which uses `Early Hints` as the more correct reason
phrase, deprecating the outdated `CHECKPOINT` enum value for 103.

Additionally:
  - `HttpStatus.valueOf(103)` will return the new enum value
  - `HttpStatusCode#isSameCodeAs(HttpStatusCode)` is introduced to ease
  comparison of deprecated enums vs their newer counterparts (or any
  instance of a more generic `HttpStatusCode`) by comparing the integer
  `value()`
  - `HttpStatusTests` covers the new deprecation as well as the three
  previously deprecated codes, including a check with the above new
  method to ensure they have comparable integer values

Supersedes and Closes gh-27960
@jhoeller jhoeller removed this from the 6.0.x milestone Jan 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: feedback-provided Feedback has been provided type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants