Repository navigation
fix(dataagent): strip POSIX base64 line wraps when downloading files - #4325
Merged
jujn merged 1 commit intoNov 22, 2026
Merged
Conversation
jujn
approved these changes
Nov 22, 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.
Problem
SharedSandboxFilesystem.downloadFiles()runsbase64 <path>inside the sandbox and decodes stdout with the strictBase64.getDecoder(). POSIXbase64inserts a\nevery 76 columns, so any payload larger than ~57 bytes contains embedded newlines..trim()removes only leading/trailing whitespace, so the embedded newlines survive and the strict decoder rejects them.The exception is caught and converted into a
FileDownloadResponse.fail(...), so downloading any moderately sized binary file from a shared sandbox silently fails withIllegal base64 character ....The sibling
BaseSandboxFilesystemalready handles this by stripping all whitespace before decoding (#3966).Fix
Strip all whitespace from stdout with
replaceAll("\\s+", "")before strict decoding, matching the sibling implementation. Also guard against a null stdout.Test
SharedSandboxFilesystemTestfeeds a MIME-wrapped base64 payload (76-column line wraps) from a mocked sandbox. Before the fix the response carrieserror = "Illegal base64 character a"; after the fix the decoded bytes match the original 128-byte payload.Verification