fix: malformed stream path escape returns routing, not a 500 - #699
Merged
davidmckayv merged 1 commit intoOct 2, 2026
Merged
Conversation
charan-rathore
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
October 1, 2026 14:56
davidmckayv
previously approved these changes
Oct 2, 2026
davidmckayv
enabled auto-merge (squash)
October 2, 2026 02:19
auto-merge was automatically disabled
October 2, 2026 05:16
Head branch was pushed to by a user without write access
charan-rathore
force-pushed
the
fix-stream-path-escape
branch
from
October 2, 2026 05:16
54cafcd to
9bd7395
Compare
Contributor
Author
|
Refreshed onto latest main. The CHANGELOG conflict and an import conflict in server/src/index.ts are resolved. I re-ran only the changed test file locally (server/tests/computer-stream-path.test.ts, 4 pass); CI will cover the rest. |
davidmckayv
approved these changes
Oct 2, 2026
davidmckayv
left a comment
Contributor
There was a problem hiding this comment.
The current head 9bd7395 matches the accepted source disposition from the refreshed triage. Required CI must pass before landing.
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 this changes
streamPathBotIdrandecodeURIComponenton the:idsegment of/api/computers/:id/stream. A malformed percent-escape such as/api/computers/%zz/streamthrows aURIErrorthat escaped the Bun fetch handler, so one bad URL became a 500.The function now returns null on a malformed escape, so normal routing answers the request. Valid ids decode as before. To unit test it I moved it into
server/src/computer/stream-path.ts, because it lived inline inserver/src/index.ts, which callsserve()at module scope. No issue was filed.Where it runs
Boundary and audit
Changelog
Proof
server/tests/computer-stream-path.test.ts(plain id, percent-encoded id,%zzand%E2%28return null, non-matching paths return null): 4 pass, 7 assertions, realbun testrun.URIErroron%zz(checked directly).bun build server/src/index.tspasses.bun run test:ciand the repo-wide typecheck run out of memory in my container, so CI is the real check. 16 app-side packages also failed to install under disk pressure; the server test suite that covers this change ran and passed.