Skip to content

Include security error body in WebFlux Cloud Foundry endpoint responses#50256

Open
htjworld wants to merge 1 commit intospring-projects:mainfrom
htjworld:fix/gh-50255
Open

Include security error body in WebFlux Cloud Foundry endpoint responses#50256
htjworld wants to merge 1 commit intospring-projects:mainfrom
htjworld:fix/gh-50255

Conversation

@htjworld
Copy link
Copy Markdown

@htjworld htjworld commented Apr 30, 2026

Problem

When a Cloud Foundry security check fails in a WebFlux application,
SecureReactiveWebOperation and CloudFoundryLinksHandler return only
the HTTP status code with no response body. The servlet counterpart
includes a {"security_error":"<reason>"} body, so the reactive path
silently discards the diagnostic information that SecurityInterceptor
already computes.

Change

Updated CloudFoundryWebFluxEndpointHandlerMapping to include
securityResponse.getMessage() as the response body in both
CloudFoundryLinksHandler.links() and
SecureReactiveWebOperation.flatMapResponse(), consistent with the
servlet implementation.

Tests

Updated operationWithSecurityInterceptorForbidden and
linksToOtherEndpointsForbidden in
CloudFoundryWebFluxEndpointIntegrationTests to assert that the
security error body is present in the response.

Closes #50255

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WebFlux Cloud Foundry endpoint responses do not include the security error body

2 participants