Nflrijal opened a new pull request, #57549: URL: https://github.com/apache/spark/pull/57549
### What changes were proposed in this pull request? 1. Overrode addProxyHeaders in JettyUtils.createProxyHandler to automatically attach/chain the X-Forwarded-Context header to all proxied HTTP requests. 2. Normalized URI path formatting in UIUtils.prependBaseUri. 3. Updated HttpSecurityFilter to skip setting Master's CSP (Content-Security-Policy) nonce header on proxied requests (/proxy/*), preventing browser CSP policy blocking of proxied inline scripts (e.g., drawApplicationTimeline for Event Timeline). 4. Added unit test in UISuite.scala to verify proxy header forwarding. ### Why are the changes needed? When spark.ui.reverseProxy=true is enabled in Spark Standalone mode, navigating between UI tabs (Jobs, Stages, Storage, Environment, Executors, Streaming) stripped the /proxy/app-XXXX/ path prefix and redirected back to the root Master web UI. In addition, Master's HttpSecurityFilter attached Master's CSP nonce to proxied responses, which conflicted with Driver's inline script nonces and blocked interactive features like the Event Timeline. ### Does this PR introduce _any_ user-facing change? Yes. Fixes navigation links and interactive UI elements (such as Event Timeline) when viewing Application UI through Master's reverse proxy (spark.ui.reverseProxy=true). ### How was this patch tested? Added unit test in UISuite: SPARK-47232: createProxyHandler forwards X-Forwarded-Context header. Manually tested batch (SparkPi) and streaming (NetworkWordCount) applications on a local Standalone cluster (Master, Worker, SparkSubmit in cluster mode), verifying that all UI tabs and Event Timeline work cleanly. ### Was this patch authored or co-authored using generative AI tooling? No -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
