Repository navigation
KNOX-3530. Ozone Recon UI broken through Knox: JS served as text/java… - #1471
Merged
Merged
Conversation
…script is not rewritten.
Test Results 4 files 4 suites 1m 33s ⏱️ Results for commit 3facf07. ♻️ This comment has been updated with latest results. |
…ript instead of changing 1.2.0
hanicz
approved these changes
Oct 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Apache Ozone has upgraded Recon's web server from Jetty 9.4 to Jetty 12 (HDDS-8280, HDDS-16683). Jetty 12 serves
.jsfiles with Content-Typetext/javascript, where Jetty 9.4 usedapplication/javascript.The
OZONE-RECON/filter/staticLinksfilter in[ozone-recon/1.2.0/rewrite.xml](https://app.notion.com/p/ozone-recon/1.2.0/rewrite.xml)was declared only forapplication/javascript. With a Jetty 12 Recon, Knox finds no matching filter and passes Recon's JS through unchanged. The/api/v1/...links are never rewritten to{gateway.url}/ozone-recon/api/v1/..., so the UI loads but every API call goes tohttps://<knox-host>:8443/api/v1/...and fails with 404.This PR changes the filter content type to
*/javascript, which matches bothapplication/javascriptandtext/javascript. Knox'sMimeTypeMapalready supports this wildcard, and theozone,ozone-scm,hdfsui,hbaseuiandhueservice definitions already use it.How was this patch tested?
Manual test against a Knox gateway in front of an Ozone Recon running Jetty 12.1.14:
text/javascript. The JS fetched through Knox (/gateway/<topology>/ozone-recon/static/js/index-*.js) was byte-identical to the JS served directly by Recon and still contained"/api/v1/clusterState". The Recon UI loaded through Knox, but its API calls failed with 404.WEB-INF/rewrite.xmlcontained<content type="*/javascript">forOZONE-RECON/filter/staticLinks."https://<knox-host>:8443/gateway/<topology>/ozone-recon/api/v1/clusterState", and the Recon UI worked through Knox.application/javascript), the rewrite was applied as before.I also ran Knox's
MimeTypeMaplocally with a*/javascriptkey. It matchedtext/javascript,application/javascriptandtext/javascript; charset=utf-8. The oldapplication/javascriptkey did not matchtext/javascript.Integration Tests
No integration test was added. This is a one-line change to a service definition. The integration suite in
.github/workflows/testsdoes not run an Ozone Recon backend, and adding one just for this case would be a large addition. The wildcard matching this change relies on is already covered byMimeTypeMapTest(e.g.*/xml,*/json).