Skip to content

Fix/5662 default content type sba settings - #5670

Open
ulischulte wants to merge 4 commits into
masterfrom
fix/5662-default-content-type-sba-settings
Open

ulischulte wants to merge 4 commits into
masterfrom
fix/5662-default-content-type-sba-settings

Conversation

@ulischulte

@ulischulte ulischulte commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

closes #5662

Issue #5662 happens when an app sets Spring MVC’s default content type to JSON. Then /sba-settings.js requests with no specific Accept header get treated as JSON requests, but SBA only serves that endpoint as JavaScript, causing 406 Not Acceptable.
This branch fixes it by adding a servlet-only filter for /sba-settings.js that changes missing or wildcard Accept headers to application/javascript. Explicit wrong headers, like Accept: application/json, still return 406. Tests reproduce the JSON default-content-type setup and verify both success and rejection cases.

Validated against demo in issue (spring-boot-admin-demo.zip)

@ulischulte
ulischulte requested a review from a team as a code owner September 18, 2026 08:15
@ulischulte
ulischulte marked this pull request as draft September 18, 2026 21:27
- Reverted UiController.sbaSettings() to normal Thymeleaf view rendering.
- Preserves Spring/Thymeleaf web context.
- Avoids _csrf regression.
- Removed misleading JSON produces.
- /sba-settings.js again truthfully produces only application/javascript.
- Explicit Accept: application/json now returns 406.
- Added servlet-only filter for /sba-settings.js.
- Rewrites missing/blank/wildcard Accept to application/javascript.
- Fixes #5662 without changing WebFlux behavior.
- Added regression test for explicit JSON accept.
@ulischulte
ulischulte marked this pull request as ready for review September 18, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: When accessing the web page, sba-settings.js throws a 406 (Not Acceptable) error.

1 participant