chore: refactor bin handler to be struct#21917
Merged
spikecurtis merged 1 commit intomainfrom Feb 6, 2026
Merged
Conversation
Contributor
Author
This was referenced Feb 4, 2026
Contributor
There was a problem hiding this comment.
Code Review
Reviewed refactoring of bin handler from function to struct. The refactor is clean and prepares for future caching functionality. Found one potential path traversal issue that should be addressed.
Summary
✅ Strengths:
- Clean refactor with clear separation of concerns
- All existing tests pass
- Good preparation for adding compressed file cache
- Maintains backward compatibility
- Path prefix check is insufficient - may allow path traversal
Details
The refactor successfully converts binHandler from a function to a struct, which is a logical change given the upcoming need to add caching state. The code maintains all existing functionality while preparing for future enhancements.
However, there's a security concern with the path prefix check that should be addressed before merge.
0320b65 to
8251b2e
Compare
1613bcb to
ac49605
Compare
8251b2e to
4429923
Compare
ac49605 to
f184efa
Compare
4429923 to
af3fb2f
Compare
f184efa to
e838f7e
Compare
af3fb2f to
9ec9c39
Compare
cstyan
approved these changes
Feb 4, 2026
678c91a to
a5bf33c
Compare
9ec9c39 to
6bb53c2
Compare
6bb53c2 to
b478cc5
Compare
a5bf33c to
541f00b
Compare
b478cc5 to
2816283
Compare
Contributor
Author
Merge activity
|
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.

relates to: coder/internal#1300
Refactors the bin handler to be a
structinstead of a handlerfunc. The reason we want this is because we are going to introduce a cache of compressed files, so we need somewhere to put this cache.