Skip to content

KNOX-3530. Ozone Recon UI broken through Knox: JS served as text/java… - #1471

Merged
hanicz merged 2 commits into
apache:masterfrom
ArafatKhan2198:KNOX-3530
Oct 28, 2026
Merged

hanicz merged 2 commits into
apache:masterfrom
ArafatKhan2198:KNOX-3530

Conversation

@ArafatKhan2198

Copy link
Copy Markdown
Contributor

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 .js files with Content-Type text/javascript, where Jetty 9.4 used application/javascript.

The OZONE-RECON/filter/staticLinks filter in [ozone-recon/1.2.0/rewrite.xml](https://app.notion.com/p/ozone-recon/1.2.0/rewrite.xml) was declared only for application/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 to https://<knox-host>:8443/api/v1/... and fails with 404.

This PR changes the filter content type to */javascript, which matches both application/javascript and text/javascript. Knox's MimeTypeMap already supports this wildcard, and the ozone, ozone-scm, hdfsui, hbaseui and hue service 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:

  1. Before the fix: Recon served its JS as 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.
  2. Applied the change to the ozone-recon service definition on the Knox hosts and restarted Knox.
  3. Checked that the new topology deployment's WEB-INF/rewrite.xml contained <content type="*/javascript"> for OZONE-RECON/filter/staticLinks.
  4. After the fix: the JS fetched through Knox contained "https://<knox-host>:8443/gateway/<topology>/ozone-recon/api/v1/clusterState", and the Recon UI worked through Knox.
  5. Regression check: against a Recon on Jetty 9.4 (serving application/javascript), the rewrite was applied as before.

I also ran Knox's MimeTypeMap locally with a */javascript key. It matched text/javascript, application/javascript and text/javascript; charset=utf-8. The old application/javascript key did not match text/javascript.

Integration Tests

No integration test was added. This is a one-line change to a service definition. The integration suite in .github/workflows/tests does 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 by MimeTypeMapTest (e.g. */xml, */json).

@github-actions

github-actions Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Test Results

  4 files    4 suites   1m 33s ⏱️
149 tests 149 ✅ 0 💤 0 ❌
173 runs  173 ✅ 0 💤 0 ❌

Results for commit 3facf07.

♻️ This comment has been updated with latest results.

@hanicz
hanicz merged commit 5982739 into apache:master Oct 28, 2026
3 checks passed
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.

2 participants