[
https://issues.apache.org/jira/browse/KNOX-3530?focusedWorklogId=1050359&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1050359
]
ASF GitHub Bot logged work on KNOX-3530:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Oct/26 16:43
Start Date: 26/Oct/26 16:43
Worklog Time Spent: 10m
Work Description: github-actions[bot] commented on PR #1471:
URL: https://github.com/apache/knox/pull/1471#issuecomment-6421690336
## Test Results
4 files 4 suites 1m 27s ⏱️
149 tests 149 ✅ 0 💤 0 ❌
173 runs 173 ✅ 0 💤 0 ❌
Results for commit 5171b23f.
[test-results]:data:application/gzip;base64,H4sIADOD32oC/13MSw7CIBSF4a00jB3Io6W4GYO33OTGthgKo8a9i6QiOvz+k5ydIc1uY5dOnTq2JYoVUwo2kl8zR52dl/jeuDIfXbcE8J/u9MjpXANamn+CC8GHo4S0lk8tD9TLpnwfi5vD4vYP/LJQzGA91/wmJAJ3CAp6RDmYQSoJqNFoA0IJO4mRPV+kAIcvBAEAAA==
Issue Time Tracking
-------------------
Worklog Id: (was: 1050359)
Time Spent: 20m (was: 10m)
> Ozone Recon UI broken through Knox: JS served as text/javascript is not
> rewritten
> ---------------------------------------------------------------------------------
>
> Key: KNOX-3530
> URL: https://issues.apache.org/jira/browse/KNOX-3530
> Project: Apache Knox
> Issue Type: Bug
> Components: KnoxSSO
> Reporter: Arafat Khan
> Assignee: Arafat Khan
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> When you open the Ozone Recon UI through Knox
> ({{{}https://<knox-host>:8443/gateway/<topology>/ozone-recon/{}}}), the page
> loads but every API call fails with 404. The browser calls
> {{https://<knox-host>:8443/api/v1/clusterState}} without the
> {{/gateway/<topology>/ozone-recon/}} prefix, so the requests never reach
> Recon. Recon itself is healthy and works fine when opened directly.
> *Root cause:*
> Knox makes Recon work behind the gateway by rewriting Recon's JavaScript
> files on the way to the browser. It adds the gateway prefix to links like
> {{{}/api/v1/clusterState{}}}. The rule that does this is in
> {{{}ozone-recon/1.2.0/rewrite.xml{}}}, and it only applies to responses with
> Content-Type {{{}application/javascript{}}}.
> Apache Ozone has upgraded Recon's web server from Jetty 9.4 to Jetty 12
> (HDDS-8280 and HDDS-16683). Jetty 12 serves {{.js}} files as
> {{text/javascript}} by default, where Jetty 9.4 used
> {{{}application/javascript{}}}. Knox doesn't match the new type, so it skips
> the rewrite and passes the JS through unchanged. The browser then calls the
> wrong URLs.
> You can see the change in Jetty's own {{{}mime.properties{}}}: Jetty 9.4 maps
> {{js=application/javascript}} and Jetty 12 maps {{{}js=text/javascript{}}}.
> * *Recon on Jetty 9.4:* the JS through Knox contains
> {{{}https://<knox-host>:8443/gateway/<topology>/ozone-recon/api/v1/clusterState{}}}.
> Works.
> * *Recon on Jetty 12:* the JS through Knox still contains the bare
> {{{}/api/v1/clusterState{}}}, exactly as Recon sent it. Fails.
> *Fix:*
> In
> {{{}gateway-service-definitions/src/main/resources/services/ozone-recon/1.2.0/rewrite.xml{}}},
> change {{<content type="application/javascript">}} to {{{}<content
> type="*/javascript">{}}}. Knox already supports this wildcard, and it matches
> both {{application/javascript}} and {{{}text/javascript{}}}. The
> {{{}ozone{}}}, {{{}ozone-scm{}}}, {{hdfsui}} and {{hue}} service definitions
> already use it.
> We tested the fix by updating the ozone-recon service definition on a Knox
> gateway in front of a Jetty 12 Recon and restarting Knox. The JS served
> through Knox then had the correct prefixed URLs, and the Recon UI worked
> through Knox.
>
>
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)