HTTP method is lost when configuring excludes in EndpointRequest#49885
Merged
bclozel merged 1 commit intospring-projects:3.5.xfrom Apr 7, 2026
Merged
Conversation
77ab29a to
8f5e08f
Compare
bclozel
pushed a commit
to dlwldnjs1009/spring-boot
that referenced
this pull request
Apr 7, 2026
EndpointRequest.withHttpMethod(...) restrictions are lost when excluding(Class<?>...), excluding(String...), or excludingLinks() are chained because each exclusion creates a new matcher without the configured method. Preserve the configured HttpMethod in both servlet and reactive matchers and add regression tests for exclusion chaining. See spring-projectsgh-49885 Signed-off-by: Lee JiWon <dlwldnjs1009@gmail.com>
8f5e08f to
56f7588
Compare
EndpointRequest.withHttpMethod(...) restrictions are lost when excluding(Class<?>...), excluding(String...), or excludingLinks() are chained because each exclusion creates a new matcher without the configured method. Preserve the configured HttpMethod in both servlet and reactive matchers and add regression tests for exclusion chaining. See spring-projectsgh-49885 Signed-off-by: Lee JiWon <dlwldnjs1009@gmail.com>
56f7588 to
b36edad
Compare
Member
|
Thanks @dlwldnjs1009 for your contribution! |
dlwldnjs1009
added a commit
to dlwldnjs1009/spring-boot
that referenced
this pull request
Apr 17, 2026
EndpointRequest.toAnyEndpoint().withHttpMethod(...) restricted endpoint paths but still allowed any HTTP method for the links path. Restrict the links path using the configured HttpMethod in both servlet and reactive matchers. See spring-projectsgh-49885 Signed-off-by: Lee JiWon <dlwldnjs1009@gmail.com>
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.
EndpointRequest.withHttpMethod(...)restrictions are lost whenexcluding(Class<?>...),excluding(String...), orexcludingLinks()are chained because each exclusion creates a new matcher without the configured method.This change preserves the configured
HttpMethodin both servlet and reactive matchers and adds regression tests forexclusion chaining.
Testing:
./gradlew :module:spring-boot-security:test --tests 'org.springframework.boot.security.autoconfigure.actuate.web.servlet.EndpointRequestTests' --tests 'org.springframework.boot.security.autoconfigure.actuate.web.reactive.EndpointRequestTests'./gradlew :module:spring-boot-security:checkFormatTest