Repository navigation
feat: harden download endpoints and document usage (#5) - #164
Open
Ratanlavate wants to merge 1 commit into
Open
Ratanlavate wants to merge 1 commit into
Ratanlavate wants to merge 1 commit into
Conversation
- Add formatDownloadContentDisposition util to sanitize quote/linebreak characters in the Content-Disposition filename - Serve 0-byte binary files (binary_content_b64: "") as application/octet-stream with Content-Length: 0 instead of falling back to text - Document the /files/download query and path parameter styles in README - Add tests covering filenames with spaces, empty binary files, 404s and Content-Disposition sanitization
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.
Resolves #5
/claim #5
Hardens both download routes: sanitizes Content-Disposition filenames (quotes, linebreaks), serves 0-byte binary files as octet-stream instead of text, documents both URL styles in README, and adds regression tests (spaces, empty binary, 404, header sanitization).
Verification: bun test (34 pass / 0 fail), biome format clean, tsc --noEmit clean, bun run build ok.