fix: preserve file API text content#37385
Draft
dev-willbird1936 wants to merge 1 commit into
Draft
Conversation
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.
Issue for this PR
Closes #37384
Type of change
What does this PR do?
The instance file API currently calls
trim()on decoded text and changes leading, trailing, and blank-line whitespace. This returns the decoded text unchanged while preserving the existing binary and invalid UTF-8 behavior, with HTTP-level regression coverage.How did you verify your code works?
PATH=/home/hermes/.bun/bin:$PATH bun test --timeout 180000 -t 'serves read endpoints' test/server/httpapi-file.test.ts- 1 passed, 1 filtered, 6 assertionsbun run typecheck- shared current-base package check reached only unrelated existing errors insrc/provider/transform.ts,src/tool/task.ts, and their tests; current hosted CI remains requiredbunx prettier --check src/server/routes/instance/httpapi/handlers/file.ts test/server/httpapi-file.test.ts- passedgit diff --check 1d2a7b4c860f6a29eb90bdda07757b2adf34ab61..HEAD- passedScreenshots / recordings
Not applicable; this is an HTTP API response-content fix.
Checklist