[BACKPORT][MINOR][UI] Encode query parameters when generating log page scripts#57166
Open
holdenk wants to merge 2 commits into
Open
[BACKPORT][MINOR][UI] Encode query parameters when generating log page scripts#57166holdenk wants to merge 2 commits into
holdenk wants to merge 2 commits into
Conversation
The log viewer pages assemble a query string from request parameters and embed it into an inline script literal. Encode that value for a JavaScript string context using the bundled commons-text StringEscapeUtils, matching the existing pattern in AllJobsPage, so the generated script stays well-formed regardless of the parameter contents. Also sanitize the parameters on the client side in log-view.js, and add a regression test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HmZGbR3Y8L84RfcfqptgGW
Encode individual query-parameter values on the server when building the log page bootstrap script, so the resulting /log requests are unambiguous. Extract the shared script-building helper into UIUtils to keep the log pages consistent. The server now emits a fully-encoded query string, so the client-side handling is reverted to a straight pass-through. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HmZGbR3Y8L84RfcfqptgGW (cherry picked from commit 4a5e27e)
Member
|
cc @huaxingao |
dongjoon-hyun
approved these changes
Jul 10, 2026
Member
There was a problem hiding this comment.
+1, LGTM with the same three comments on the original PR. Thank you, @holdenk .
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?
The log viewer pages assemble a query string from request parameters and embed it into an inline script literal. Encode that value for a JavaScript string context using the bundled commons-text StringEscapeUtils, matching the existing pattern in AllJobsPage, so the generated script stays well-formed regardless of the parameter contents. Also sanitize the parameters on the client side in log-view.js, and add a regression test.
Backport to 4.x of #57165
Why are the changes needed?
Formatting can get funky with unescaped parameters.
Does this PR introduce any user-facing change?
No
How was this patch tested?
New test
Was this patch authored or co-authored using generative AI tooling?
Primarily Claude 4.8