Skip to content

HTTP method is lost when configuring excludes in EndpointRequest#49885

Merged
bclozel merged 1 commit intospring-projects:3.5.xfrom
dlwldnjs1009:endpointrequest-excluding-httpmethod
Apr 7, 2026
Merged

HTTP method is lost when configuring excludes in EndpointRequest#49885
bclozel merged 1 commit intospring-projects:3.5.xfrom
dlwldnjs1009:endpointrequest-excluding-httpmethod

Conversation

@dlwldnjs1009
Copy link
Copy Markdown
Contributor

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.

This change preserves the configured HttpMethod in both servlet and reactive matchers and adds regression tests for
exclusion 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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 3, 2026
@bclozel bclozel self-assigned this Apr 7, 2026
@bclozel bclozel changed the base branch from main to 3.5.x April 7, 2026 14:31
@bclozel bclozel added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 7, 2026
@bclozel bclozel added this to the 3.5.14 milestone Apr 7, 2026
@bclozel bclozel force-pushed the endpointrequest-excluding-httpmethod branch from 77ab29a to 8f5e08f Compare April 7, 2026 14:55
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>
@bclozel bclozel force-pushed the endpointrequest-excluding-httpmethod branch from 8f5e08f to 56f7588 Compare April 7, 2026 14:56
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>
@bclozel bclozel force-pushed the endpointrequest-excluding-httpmethod branch from 56f7588 to b36edad Compare April 7, 2026 14:57
@bclozel bclozel merged commit b36edad into spring-projects:3.5.x Apr 7, 2026
4 checks passed
@bclozel
Copy link
Copy Markdown
Member

bclozel commented Apr 7, 2026

Thanks @dlwldnjs1009 for your contribution!

@wilkinsona wilkinsona changed the title Preserve HttpMethod in EndpointRequest exclusions HTTP method is lost when configuring excludes in EndpointRequest Apr 7, 2026
@dlwldnjs1009 dlwldnjs1009 deleted the endpointrequest-excluding-httpmethod branch April 8, 2026 01:29
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants