chennaji9 opened a new pull request, #6888: URL: https://github.com/apache/rocketmq-dashboard/pull/6888
### Which Issue(s) This PR Fixes None — small self-contained fix found by inspection (no issue tracked). ### Brief Description `GlobalExceptionHandler.handleHttpRequestMethodNotSupportedException` answers 405 with `@ResponseStatus` and a `Result<?>` body. Taking over the response this way keeps the status and the envelope, but drops the supported-methods information the exception carries — so 405 responses leave without the `Allow` header that RFC 9110 (§15.4.5) says a client can rely on to discover the correct method. The handler now returns `ResponseEntity<Result<?>>`: same 405, same envelope, plus `Allow` populated from `ex.getSupportedHttpMethods()` whenever Spring knows the supported set. ### How Did You Test This Change? `mvn -B -ntp test -Dtest=GlobalExceptionHandlerTest` → **Tests run: 8, Failures: 0** (7 existing + 1 new). New case `methodNotAllowedKeepsTheAllowHeader`: standalone MockMvc over a GET-only test endpoint, POST it, assert status 405 and `Allow: GET`. Red side: against the unfixed handler the same test fails on the missing `Allow` header. ### Checklist - [x] One coherent change; unrelated modifications are not bundled in - [x] Commit subject follows Conventional Commits (`fix:`) - [x] Tests added or updated for non-trivial changes (1 new red-green test) - [x] New UI text has both Chinese and English entries under `web/src/i18n/` (n/a — no UI change) - [x] Architecture constraints stay green (same module, no new dependency) - [x] New source files carry the ASF license header (n/a — no new source file) - [x] Documentation touched where behaviour changed (n/a — the header contract is defined by RFC 9110) 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
