Repository navigation
Read clientName among other query parameters - #59
Merged
Merged
Conversation
The WebSocket endpoint read the client's name by splitting the whole query string on "=", and kept it only if that gave exactly two parts, without checking the parameter's name. A client that sent any other parameter lost its name, and a malformed escape threw out of onOpen. It now finds the clientName parameter among the others, and a malformed one gives an empty name. epics2web.js appended "?clientName=" even to a url option that already had a query string; it now appends with "&" then. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slominskir
approved these changes
Oct 5, 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 changed
MonitorEndpoint.onOpenreadclientNameby splitting the whole query string on=, and kept the result only if that gave exactly two parts. It never checked the parameter's name. So:?a=1&clientName=x, lost its name;?foo=barnamed the clientbar;clientName=%zz, madeURLDecoderthrowIllegalArgumentExceptionout ofonOpen.The parsing moves to
MonitorEndpoint.clientName(query). It finds theclientNameparameter among any others and decodes it as UTF-8; a missing or malformed one gives an empty name, as a missing one did before.epics2web.jsappended?clientName=even when theurloption already had a query string, which made exactly the query that broke. It now appends with&then. With the defaulturl, which has no query string, the result is the same as before.This was noticed while adding the disconnected PVs report (#58), which shows clients by name. WEDM and the default
epics2web.jssend no other parameters, so they weren't affected.Deployment
None.
Checks
./gradlew spotlessCheck test: passed, 84 unit tests. 3 are new, inMonitorEndpointTest: other parameters in any order, decoding an encoded page address, and missing, empty or malformed names../gradlew integrationTest, after rebuilding the image: passed, 26 tests. 1 is new, inClientNameTest: the console shows a name that contains=and&and is sent between other parameters.🤖 Generated with Claude Code