Repository navigation
Conversation
Versioned CSS resources lose their ETag when their content is transformed to rewrite resource links. Derive a weak ETag from the transformed bytes when the original resource provides an ETag. Preserve configured ETag generator precedence for transformed resources and the existing header behavior for other HTTP resources. See spring-projectsgh-26364 Signed-off-by: CCCLL <cccll2019@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Versioned CSS resources lose their ETag when
CssLinkResourceTransformercreates aTransformedResource. Both MVCand WebFlux then serve the rewritten content without that response
header.
This change makes
TransformedResourceimplementHttpResource. Whenthe original resource has an ETag, it derives a weak ETag from the
current transformed bytes. This also covers a CSS file whose referenced
resource URLs change while its own source version stays the same.
Other original HTTP response headers are not inherited.
For transformed resources, a configured ETag generator keeps precedence,
including when it returns
null. The existing header behavior for otherHTTP resources and the conditional request flow remain unchanged.
Validation:
./gradlew :spring-webmvc:check :spring-webflux:check, including tests,NullAway, Checkstyle and architecture checks.
defaults bound to
127.0.0.1to avoid collisions with existing localapplications. That local fixture adjustment is outside this PR.
See #26364.