Skip to content
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

Refactor ETag-related logic for improved readability #33770

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

smartandhandsome
Copy link
Contributor

@smartandhandsome smartandhandsome commented Oct 22, 2024

  • Refactored isEligibleForEtag to simplify method signature by removing unnecessary parameters.
  • Refactored if statement for better readability.

I noticed that in the isEligibleForEtag method, it is validating the response status code for any successful range (200–299, ShallowEtagHeaderFilter.java > line 151).

but in checkNotModified, it is strictly checking for 200 OK(DefaultServerWebExchange.java > 308 line, ServletWebRequest.java > 210 line). I’m wondering if these conditions should be aligned for consistency. Should checkNotModified also handle a broader range of successful status codes, or is there a reason to limit it to 200 OK?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 22, 2024
@smartandhandsome smartandhandsome changed the title Refactor checkNotModified logic for improved readability Refactor ETag-related logic for improved readability Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants