liudawang001 opened a new pull request, #6990:
URL: https://github.com/apache/shenyu/pull/6990
### What happened?
`ModifyResponseDecorator` only overrides `writeWith()`.
For streaming responses such as SSE and NDJSON, WebFlux invokes
`writeAndFlushWith()`, which previously bypassed
`modifyResponseHeadersAndStatus()`. As a result, configured response headers
and status codes were not applied.
### What does this PR do?
Override `writeAndFlushWith()` in `ModifyResponseDecorator` and invoke
`modifyResponseHeadersAndStatus()` before delegating the original streaming
body.
The body is neither aggregated nor modified, so the original streaming and
flush behavior is preserved.
### Tests
Added a regression test covering the `writeAndFlushWith()` path.
Verified that:
- Without the fix, the regression test fails because the configured response
header is not applied.
- With the fix, the regression test passes.
- All 8 tests in `shenyu-plugin-modify-response` pass.
- Checkstyle reports no violations.
- `git diff --check` passes.
Fixes #6659
Make sure that:
- [x] You have read the [contribution
guidelines](https://shenyu.apache.org/community/contributor-guide).
- [x] You submit test cases (unit or integration tests) that back your
changes.
- [ ] Your local test passed `./mvnw clean install
-Dmaven.javadoc.skip=true`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]